nginx 负载均衡proxy 配置
在http模块 加入
upstream fuzai{
server 192.168.1.1; #有端口的话-格式: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 REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}