1. 在http节点下,添加upstream节点。
upstream www.xxx.com{
server 10.0.6.108:7080;
server 10.0.0.85:8980;
}
2. 将server节点下的location节点中的proxy_pass配置为:http:// + upstream名称,即“
http://www.xxx.com”.
location / {
root html;
index index.html index.htm;
proxy_pass http://www.xxx.com;
}