乱码时光

个人收藏夹

Nginx 负载均衡配置

2019-10-1

upstream slave_hosts {
    server 192.168.199.101:80 weight=1;
    server 192.168.199.102:80 weight=1;
}

server {
  listen 80;
  server_name www.nginx-test.me ;
  index index.html index.htm index.php default.html default.htm default.php;
  root  /home/wwwroot/www.nginx-test.me;

  location / {
      # proxy_set_header Host www.ng.me;
      proxy_pass http://slave_hosts;
  }

  access_log  /home/wwwlogs/www.nginx-test.me.log;
}