I have an aws lightsail instance.In plesk panel i have a node.js webiste and in this there is a blog folder which contains wordpress website.There is no problem with main website and blog homepage.But if I click any blog post I am getting 404 not found nginx error.
I changed nginx.conf file but nothing changed.
My nginx.conf file under /var/www/vhosts/system/example.com/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;
}