我在同一台服务器上的Varnish(4.1.0)前面有Nginx(1.9.9).
//Nginx
upstream varnish {
server 127.0.0.1:8391;
keepalive 16;
}
location ~ \.PHP${
proxy_pass http://varnish;
proxy_http_version 1.1; #for 1.0 varnish shows blank page
proxy_set_header Connection "";
proxy_redirect off;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 600;
proxy_send_timeout 600;
proxy_connect_timeout 600;
}
//varnish
DAEMON_OPTS="-a :8391 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,1024m"
[error] 5331#5331: *7392847 upstream prematurely closed connection while reading response header from upstream,client: xx.xx.xx.xx,server: _,request: "GET /home HTTP/1.1",upstream: "http://127.0.0.1:8391/index.PHP?q=/home",host: "xxx",referrer: "xxx"
使用proxy_buffers没有帮助.
最佳答案
原文链接:https://www.f2er.com/nginx/435229.html