upstream lxppp{
server 192.168.37.161:8082 weight=1 max_fails=5 fail_timeout=30s;
server 192.168.37.161:8080 weight=1 max_fails=5 fail_timeout=30s;
}
server {
listen 80;
server_name www.lxppp.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://lxppp;
index index.html index.htm;
}
}
配置如上,权重都是1的时候一直是访问第一个服务器,把第一个服务器权重改为2就有效,上面那个服务器访问两次,下面那个一次