nginx负载均衡
第一步:设置服务器组
upstream backend{
#weight为权重,不设置默认为轮询 server 192.168.98.92:8081 weight=5; server 192.168.98.100:8081 weight=5; server 192.168.98.98:8081 weight=1; }
第二步:设置反向代理后端服务器
server{ listen 80; server_name cx.com; index index.html index.php; location / { proxy_pass http://backend;
proxy_set_header Host $host; } }