nginx.conf 文件 http项里面加入
upstream test.com {
#test.com是该负载均衡的名字,最好和域名相同,要不跟squid通信是不成功
#这里可以设置调度算法和添加多台机器
server 127.0.0.1:3128;
}
server {
listen 80;
server_name www.test.com;
location / {
proxy_pass http://test.com;
#proxy_redirect off;
#proxy_set_header Host $host:80;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}