清漆+ Nginx + WordPress:使用清漆get的redirect循环

我有两个使用Wordpress和Nginx的网站,并试图把Varnish放在前面,但是当把Nginx的监听端口改为8080时,所有网站都进入redirect循环。

在启用的网站,我有所有不同的主机分开的文件,因此:

server { server_name xpto.xyz.com; root /usr/share/nginx/www/xpto.xyz.com; include global/common.conf; include global/wordpress.conf; } 

在common.conf中,我已经configuration了要听的端口。

在光油方面,我有以下清漆文件:

 DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -s malloc,256m" 

而在default.vcl中有:

 backend default { .host = "127.0.0.1"; .port = "8080"; } # Drop any cookies sent to WordPress. sub vcl_recv { if (!(req.url ~ "wp-(login|admin)")) { unset req.http.cookie; } } # Drop any cookies WordPress tries to send back to the client. sub vcl_fetch { if (!(req.url ~ "wp-(login|admin)")) { unset beresp.http.set-cookie; } } 

任何人都可以帮我吗? 提前致谢。

我认为你的wordpress可能是做了一个redirect,因为它看到的stream量来自127.0.0.1:8080,并希望redirect到规范的网站名称。 尝试使用curl从堆栈的不同层中检索站点,并且应该能够validation自己。