plesk子文件夹/博客wordpress nginx 404未找到

我有一个aws lightail实例。在plesk面板中有一个node.js Webiste,其中有一个包含wordpress网站的博客文件夹。主网站和博客主页都没有问题,但是如果我单击任何博客发布我得到404找不到nginx错误。

我更改了nginx.conf文件,但没有任何更改。

/var/www/vhosts/system/example.com/conf /

下的我的nginx.conf文件
server {
listen 171.26.10.103:443 ssl http2;

server_name example.com;
server_name www.example.com;
server_name ipv4.example.com;

ssl_certificate/opt/psa/var/certificates/certSiSwQOP;
ssl_certificate_key/opt/psa/var/certificates/certSiSwQOP;

client_max_body_size 128m;

 # mailconfig
location ~* ^/autodiscover/autodiscover\.xml$ {
try_files $uri @mad;
}
location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
try_files $uri @mad;
}
location @mad {
rewrite ^(.*)$ /mailconfig/ break;

proxy_passhttp://127.0.0.1:8880;
proxy_set_header X-Host$host;
proxy_set_header X-Request-URI$request_uri;
}
 # mailconfig

root "/var/www/vhosts/example.com/httpdocs";
access_log "/var/www/vhosts/system/example.com/logs/proxy_access_ssl_log";
error_log "/var/www/vhosts/system/example.com/logs/proxy_error_log";

 #extension letsencrypt begin
location ^~ /.well-known/acme-challenge/ {
root /var/www/vhosts/default/htdocs;

types { }
default_type text/plain;

satisfy any;
auth_basic off;
allow all;

location ~ ^/\.well-known/acme-challenge.*/\. {
deny all;
}
}

#extension letsencrypt end

 #extension sslit begin

 #extension sslit end

location / {
proxy_pass https://171.26.10.103:7081;
proxy_set_header Host$host;
proxy_set_header X-Real-IP$remote_addr;
proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
proxy_set_header X-accel-Internal /internal-nginx-static-location;
access_log off;

location /internal-nginx-static-location/ {
alias /var/www/vhosts/example.com/httpdocs/;
internal;
}

location ~ ^/(plesk-stat|awstats-icon|webstat|webstat-ssl|ftpstat|anon_ftpstat) {
proxy_pass https://171.26.10.103:7081;
proxy_set_header Host$host;
proxy_set_header X-Real-IP$remote_addr;
proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
proxy_set_header X-accel-Internal /internal-nginx-static-location;
access_log off;


location ~ "^/files/" {
proxy_pass https://171.26.10.103:7081;
proxy_set_header Host$host;
proxy_set_header X-Real-IP$remote_addr;
proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
proxy_set_header X-accel-Internal /internal-nginx-static-location;
access_log off;

}

location /blog {
index index.php index.html index.htm;
try_files $uri $uri/ /blog/index.php?q=$uri&$args;

}
add_header X-Powered-By PleskLin;

}


server {
listen 172.26.10.103:80;

server_name example.com;
server_name www.example.com;
server_name ipv4.example.com;

client_max_body_size 128m;

 # mailconfig
location ~* ^/autodiscover/autodiscover\.xml$ {
try_files $uri @mad;
}
location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
try_files $uri @mad;
}
location @mad {
rewrite ^(.*)$ /mailconfig/ break;

proxy_passhttp://127.0.0.1:8880;
proxy_set_header X-Host$host;
proxy_set_header X-Request-URI$request_uri;
}
 # mailconfig

return 301 https://$host$request_uri;
}
hermite1 回答:plesk子文件夹/博客wordpress nginx 404未找到

这解决了我的问题https://support.plesk.com/hc/en-us/articles/213912945 在Plesk中,将以下内容添加到WordPress域的Additional nginx指令字段中,位于域> example.com> Apache&nginx设置:

if (!-e $request_filename) {
set $test P;
}
if ($uri !~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon|internal-nginx-static-location)) {
set $test "${test}C";
}
if ($test = PC) {
rewrite ^/(.*)$ /blog/index.php?$1;
}
本文链接:https://www.f2er.com/2777865.html

大家都在问