wordpress+nginx 上 302 重定向,页面空白

wordpress+nginx 上 302 重定向,页面空白

我的 wordpress MU 设置(带有 Nginx)显示一个空白页,其中包含以下错误和访问日志条目。

"GET / HTTP/1.1" **302** 293 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19"
"GET /favicon.ico HTTP/1.1" 200 0 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19"

在主页上,打开 wordpress 中的调试后,我收到以下警告(不确定他们是否造成了问题)

Notice: Undefined index: HTTPS in /home/optimizebuzz/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase1.php on line 526
Notice: Undefined index: HTTP_X_FORWARDED_PROTO in /home/optimizebuzz/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase1.php on line 526

以下是我的 nginx 配置:

nginx.conf

user www-data www-data;
worker_processes  2;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

# Keeps the logs free of messages about not being able to bind().
#daemon     off;

events {
        worker_connections  1024;
}

http {
#       rewrite_log on;
        include mime.types;
        default_type       application/octet-stream;
        access_log         /var/log/nginx/access.log;
        sendfile           on;
#       tcp_nopush         on;
        keepalive_timeout  3;
#       tcp_nodelay        on;
#       gzip               on;
        client_max_body_size 25M;
        index              index.php index.html index.htm;

        # Upstream to abstract backend connection(s) for PHP.
        upstream php {
                server unix:/tmp/php-fpm.sock;
        }

        include sites-enabled/*;
}




**--------------------------------**

server {
listen 8080;
server_name *.optimizebuzz.com;
        root /home/optimizebuzz/public_html;

        location ~* ^.+\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$
        {
                root /home/optimizebuzz/public_html;
                rewrite ^/.*(/wp-.*/.*\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ $1 last;
                rewrite ^.*/files/(.*(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$
                /wp-content/blogs.php?file=$1 last;
                expires 30d;
                break;
        }
error_page 404 = /index.php?q=$uri;
        include global/wp-supercache.conf;
        include global/restrictions.conf;
        include global/wordpress.conf;
}

答案1

这看起来像是 wp-super-cache 中对标头的处理不当;我注意到这可能会在未来的更新中得到更新(修补);您是否尝试过更新 wp-super-cache?

答案2

第一个调试行似乎指向了问题。似乎插件“wp-super-cache”行为不当。由于您没有使用默认的 Wordpress 安装,因此在将其恢复到原始默认状态之前,没有太多其他调试工作要做。

禁用该插件,然后清除浏览器缓存(或使用其他浏览器),然后尝试再次导航到您的网站。请注意,所有浏览器都会大量缓存 302 重定向,因此访问网站并获取 302 意味着您将重定向一段时间,即使实时网站上的 302 已消失。

相关内容