ERR_TOO_MANY_REDIRECTS WordPress多站点+ Nginx

时间:2019-05-24 09:13:56

标签: wordpress nginx multisite

我有三个WordPress安装/basketball /football/kitesurfen是在nginx.conf文件中定义的,并具有单独的目录。

删除了所有配置,并在/路径上安装了多站点。

当我使用以前的路径之一创建新站点时,例如/basketball /football/kitesurfen,我无法访问仪表板。我得到ERR_TOO_MANY_REDIRECTS和基于浏览器的其他错误。

如果我创建的网站具有其他任何路径,例如/test /volleyball/swimming,则可以正常工作。

需要帮助解决此问题。我不确定是WordPress(PHP)错误还是Nginx配置错误。

Nginx Conf
if (!-e $request_filename) {
    rewrite ^/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) /$2 break;
}

location / {
    root /var/www/html/multinetworks/networktheme;
    index index.html index.htm index.php;
    rewrite ^/([_0-9a-zA-Z-]+/)?wp-admin$ /$1wp-admin/ redirect;
    rewrite ^/([_0-9a-zA-Z-]+/)?(.*\.php)$ /$2 break;
    rewrite ^/([_0-9a-zA-Z-]+/)?(.*\.php)$ /$2 break;

    try_files $uri $uri/ /index.php$is_args$args;
    location = /favicon.ico {
        log_not_found off; access_log off;
    }
    location = /robots.txt {
        log_not_found off; access_log off; allow all;
    }
    location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
        expires max;
        log_not_found off;
    }
    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
        fastcgi_index index.php;
    }
}

0 个答案:

没有答案
相关问题