重定向周期 Varnish

我试图使用许多赌注配置并始终遇到相同的重定向周期,在时钟对期间抛光后,在某些页面上显示一条消息:

The page isn't redirecting properly

在 firefox.

如图所示,第一个请求返回状态代码 301, 休息 - 302, 我不知道这个国家代码在哪里 302, 在我的配置中 nginx 我有:

# We don't want someone to visit a default site via IP
# So we catch all non-defined Hosts or blank hosts here
# the default listen will cause this server block to be used
# when no matching hostname can be found in other server blocks
server {
# use default instead for nginx 0.7.x, default_server for 0.8.x+
listen 81 default_server;
# if no listen is specified, all IPv4 interfaces on port 80 are listened to
# to listen on both IPv4 and IPv6 as well, listen [::] and 0.0.0.0 must be specified.
server_name _;
return 301 $scheme://elbauldelprogramador.com$request_uri;
}

在支持的网站 / mysite:

server {
listen 127.0.0.1:81;
server_name www.elbauldelprogramador.com;
return 301 $scheme://elbauldelprogramador.com$request_uri;
}
server {
listen 127.0.0.1:81;
server_name elbauldelprogramador.com

#rest of configuration
}

也许问题是重定向 301? 我当前的配置 varnish 这样的 (虽然它发生在我证明的所有配置中).

# Enter your backend Wordpress site here.
backend default {
.host = "127.0.0.1"; # XXX CHANGE THIS
.port = "81"; # (and maybe this)
.connect_timeout = 60s;
.first_byte_timeout = 60s;
.between_bytes_timeout = 60s;
.max_connections = 800;
}

acl purge {
"127.0.0.1";
}

# Drop any cookies sent to Wordpress.
sub vcl_recv {
if (req.request == "PURGE") {
if (!client.ip ~ purge) {
error 405 "Not allowed.";
}
return (lookup);
}

if (req.http.host ~ "(?i)^(www.)?elbauldelprogramador.com") {
set req.http.host = "elbauldelprogramador.com";
}

# Normalize encoding
if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") {
# No point in compressing these
remove req.http.Accept-Encoding;
} elsif (req.http.Accept-Encoding ~ "gzip") {
set req.http.Accept-Encoding = "gzip";
} elsif (req.http.Accept-Encoding ~ "deflate") {
set req.http.Accept-Encoding = "deflate";
} else {
# unknown algorithm
remove req.http.Accept-Encoding;
}
}
if (!(req.url ~ "wp-(login|admin|cron)")) {
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;
}
}

sub vcl_hit {
if (req.request == "PURGE") {
purge;
error 200 "Purged.";
}
}

sub vcl_miss {
if (req.request == "PURGE") {
purge;
error 200 "Purged.";
}
}
已邀请:

要回复问题请先登录注册