Nginx负载均衡基本配置
upstream a.com {
server 192.168.5.126:80;
server 192.168.5.27:80;
}
server{
listen 80;
server_name a.com;
location / {
proxy_pass http://a.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;
}
}