在http模块 加入

upstream fuzai{

server 服务器ip;      #有端口的话 ip:端口 默认80端口可以不写
}

 

在server 模块需要负载的location加入

location / {

proxy_pass http://fuzai;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr; 

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

…………………

}