NginX学习&实践

来源:互联网 发布:js正则判断是否为数字 编辑:程序博客网 时间:2024/06/08 02:04

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;
            }
        }
    }



0 0