Nginx + WordPress漂亮的永久链接返回404



即使在这里提出的所有nginx + WordPress永久链接问题之后仍然卡住。

我有WordPress安装在子目录digitext-v1。根目录下只有phpinfo文件

root -->    /var/www
subdirectory -->   /var/www/digitext-v1

普通的永久链接在主页和所有页面上都可以正常工作。漂亮的永久链接与主页工作,但给所有其他404错误。

配置文件如下所示。有几乎相同的设置(除了服务器名称中使用的fqdn),我的实时Nginx服务器,漂亮的永久链接工作得很好。

你能在我失去理智之前帮我解决这个问题吗?和域名有关吗?我做错了什么?
server {
listen 80;
server_name digitextv1 192.168.11.8;
root   /var/www/digitext-v1;
index  index.php index.html index.htm;
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

location / {
# Setting pretty permalinks in WordPress
# First attempt to serve request as file ($uri)
# or directory ($uri/).
try_files $uri $uri/ /index.php?$args;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
include        fastcgi_params;
}
}

EDIT(从错误日志中删除几行)

2021/08/31 16:05:48 [error] 3185#3185: *1406 FastCGI sent in stderr: "PHP message: PHP Warning:  preg_match() expects parameter 2 to be string, array given in /var/www/digitext-v1/wp-content/plugins/popup-maker/includes/functions/popups/template.php on line 106PHP message: PHP Warning:  preg_match() expects parameter 2 to be string, array given in /var/www/digitext-v1/wp-content/plugins/popup-maker/includes/functions/popups/template.php on line 106" while reading upstream, client: 192.168.11.41, server: 192.168.11.8, request: "GET /digitext-v1/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.11.8", referrer: "http://192.168.11.8/digitext-v1/wp-admin/options-permalink.php"
2021/08/31 16:06:28 [error] 3185#3185: *1426 FastCGI sent in stderr: "PHP message: PHP Warning:  preg_match() expects parameter 2 to be string, array given in /var/www/digitext-v1/wp-content/plugins/popup-maker/includes/functions/popups/template.php on line 106" while reading upstream, client: 192.168.11.41, server: 192.168.11.8, request: "GET /digitext-v1/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.11.8"
2021/08/31 16:06:28 [error] 3185#3185: *1426 FastCGI sent in stderr: "PHP message: PHP Warning:  preg_match() expects parameter 2 to be string, array given in /var/www/digitext-v1/wp-content/plugins/popup-maker/includes/functions/popups/template.php on line 106PHP message: PHP Warning:  preg_match() expects parameter 2 to be string, array given in /var/www/digitext-v1/wp-content/plugins/popup-maker/includes/functions/popups/template.php on line 106" while reading upstream, client: 192.168.11.41, server: 192.168.11.8, request: "GET /digitext-v1/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.11.8"
2021/08/31 16:09:59 [error] 3185#3185: *1438 FastCGI sent in stderr: "PHP message: PHP Warning:  preg_match() expects parameter 2 to be string, array given in /var/www/digitext-v1/wp-content/plugins/popup-maker/includes/functions/popups/template.php on line 106" while reading upstream, client: 192.168.11.41, server: 192.168.11.8, request: "GET /digitext-v1/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.11.8", referrer: "http://192.168.11.8/digitext-v1/wp-admin/options-permalink.php"
2021/08/31 16:09:59 [error] 3185#3185: *1438 FastCGI sent in stderr: "PHP message: PHP Warning:  preg_match() expects parameter 2 to be string, array given in /var/www/digitext-v1/wp-content/plugins/popup-maker/includes/functions/popups/template.php on line 106PHP message: PHP Warning:  preg_match() expects parameter 2 to be string, array given in /var/www/digitext-v1/wp-content/plugins/popup-maker/includes/functions/popups/template.php on line 106" while reading upstream, client: 192.168.11.41, server: 192.168.11.8, request: "GET /digitext-v1/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.11.8", referrer: "http://192.168.11.8/digitext-v1/wp-admin/options-permalink.php"

我这周也遇到了同样的问题。我甚至尝试重置WordPress,但没有成功。我上传了我的.htacess文件给我的主持人导师Chris。在DNS和一些来回之后,他删除了以下代码来解决问题:

RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
<Files *config.json*>
order allow,deny
deny from all
</Files>

最新更新