tigh 发表于 2018-11-9 10:34:05

负载均衡集群解决方案 (二)Nginx-My

http {  upstream web_pool {
  server 172.23.136.148:80 weight=10;
  server 172.23.136.149:80 weight=5;
  healthcheck_enabled;
  healthcheck_delay 1000;
  healthcheck_timeout 1000;
  healthcheck_failcount 2;
  healthcheck_send "GET /.health HTTP/1.0";
  }
  server {
  listen 80;
  location / {
  proxy_set_header Host $http_host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_pass http://web_pool;
  proxy_connect_timeout 3;
  }
  location /stat {
  healthcheck_status;
  }
  }

页: [1]
查看完整版本: 负载均衡集群解决方案 (二)Nginx-My