在配置文件vim /usr/local/nginx/conf/nginx.conf中添加以下内容。
upstream web-server{
ip_hash;
server 192.168.201.145 fail_timeout=60s weight=3;
server 192.168.201.146 weight=6;
}
server
{
listen 80;
server_name localhost;
location /{
proxy_pass http://web-server;
root html;
index index.html index.htm;
}
}
保存退出后重启一下nginx就可以了