我有两个网站使用Wordpress和Nginx,并试图把清漆在前面,但当把Nginx的监听端口到8080时,所有的网站进入一个重定向循环。
在启用的站点中,我将所有不同的主机按文件分隔开,如下所示:
server {
server_name xpto.xyz.com;
root /usr/share/nginx/www/xpto.xyz.com;
include global/common.conf;
include global/wordpress.conf;
}在common.conf中,我配置了要侦听的端口。
就清漆而言,我有以下清漆文件:
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;
}
}有人能帮我吗?提前谢谢。
发布于 2014-03-19 21:59:26
我认为您的wordpress可能正在进行重定向,因为它看到流量以127.0.0.1:8080的速度出现,并且希望重定向到规范的站点名。尝试使用curl从堆栈的不同层检索站点,您应该能够自己验证这一点。
https://serverfault.com/questions/583243
复制相似问题