upstream yaoyafei.com{ 地址池
server 192.168.1.11:89 weight=10; 代理的地址和端口 权重weight=10
server 192.168.1.12:89 weight=10;
}
server{ 创建新的虚拟机
listen 80; 负载均衡控制节点监听的端口号
server_name yaoyafei.com; 服务域名
location / {
proxy_pass http://yaoyafei.com;
proxy_set_header Host $Host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
nginx-负载均衡
最新推荐文章于 2024-10-29 19:42:44 发布