NginX學習&實踐

20161205 17:13——17:30

 操作備註:本文檔用於記錄關於nginX學習和實踐|使用中的要點。

負載均衡功能板塊

Using nginx as HTTP load balancer

http://nginx.org/en/docs/http/load_balancing.html

Introduction:
  Load balancing across multiple application instances is a commonly used technique for optimizing resource utilization, maximizing throughput, reducing latency, and ensuring fault-tolerant configurations.
  It is possible to use nginx as a very efficient HTTP load balancer to distribute traffic to several application servers and to improve performance, scalability and reliability of web applications with nginx.

1.Default load balancing configuration

The simplest configuration for load balancing with nginx may look like the following:

    http {
        upstream myapp1 {
            server srv1.example.com;
            server srv2.example.com;
            server srv3.example.com;
        }

        server {
            listen 80;

            location / {
                proxy_pass http://myapp1;
            }
        }
    }



發佈了27 篇原創文章 · 獲贊 15 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章