Wordpress 清漆缓存&x2B;Nginx+;重定向循环
我一直在玩Varnish,但我遇到了一个问题,导致我的所有站点(主要是Wordpress和Drupal)都出现无限重定向循环。Curl到localhost:8080,并将“Host”设置为头输出正确的html,因此它不是Nginx,但是当Curl到localhost(点击varnish)时,响应是“301永久移动” 有什么想法吗 以下是站点的vhost配置:Wordpress 清漆缓存&x2B;Nginx+;重定向循环,wordpress,curl,nginx,varnish,varnish-vcl,Wordpress,Curl,Nginx,Varnish,Varnish Vcl,我一直在玩Varnish,但我遇到了一个问题,导致我的所有站点(主要是Wordpress和Drupal)都出现无限重定向循环。Curl到localhost:8080,并将“Host”设置为头输出正确的html,因此它不是Nginx,但是当Curl到localhost(点击varnish)时,响应是“301永久移动” 有什么想法吗 以下是站点的vhost配置: index index.php; server { server_name www.example.com;
index index.php;
server {
server_name www.example.com;
rewrite ^ $scheme://example.com$request_uri? permanent;
}
server {
listen 8080;
server_name example.com;
access_log /var/www/logs/access.log;
error_log /var/www/logs/error.log;
root /var/www/example.com/public_html;
include global/restrictions.conf;
location / {
try_files $uri $uri/ /index.php;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
}
Varnish的配置可以在这里找到:
不过我稍微修改了一下,所以端口看起来是8080
谢谢我想你需要
听8080代码>也进入第一个服务器:
server {
listen 8080;
server_name www.example.com;
rewrite ^ $scheme://example.com$request_uri? permanent;
}
如果您仍然在寻找一个有效的解决方案,您可以在最新的Plesk Onyx版本的Docker容器中使用清漆
教程:啊,对了,这是有道理的。等我有机会再联系你,我会试试的!谢谢