squid后面的nginx如果有proxy_pass的话会504?
把nginx放到了squid后面,一般的server都没有问题,有一个server里面使用了proxy mod,这时通过squid访问proxy过得url就会504,而直接访问没有问题,具体描述:
1.nginx配置
server {
listen 192.168.0.10:80;
server_name tech.test.com;
proxy_next_upstream error;
location = /data/js/config.js {
root /opt/tmp/test;
}
location /news {
proxy_pass http://news.test.net;
proxy_redirect off;
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://tech.test.com/data/js/config.js和http://tech.test.com/news/xx.html没有问题
2.前面加上一个squid,通过squid访问http://tech.test.com/data/js/config.js没有问题,访问http://tech.test.com/news/xx.html就会 504 gateway timeout,nginx错误日志:
[Copy to clipboard] [ - ]
CODE:
2008/09/23 08:58:43 [error] 17645#0: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: tech.test.com, request: "GET /news/2008/0912/16357.html HTTP/1.0", upstream: "http://192.168.0.16:80/news/2008/0912/16357.html", host: "tech.test.com"
怎么解决呢?谢谢