在nginx配置文件"/etc/nginx/nginx.conf" http节点增加以下内容:
如域名:admin.wxh.com负载到两台服务器
http {
//...省略此行上面其他配置内容
upstream admin.wxh.com{
server 10.0.0.11:9000 weight=1;
server 10.0.0.11:8000 weight=3;
}
server{
listen 80;
server_name admin.wxh.com;
location / {
proxy_pass http://admin.mewxh.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;
}
}
}
原文:http://my.oschina.net/moks/blog/531675