I have a website that address is site.com
and also a WordPress that is site.com/blog
. I would change the WordPress root directory in the nginx.
here is my config:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/html;
index index.php index.html index.htm;
server_name localhost;
server_name site.com www.site.com;
location / {
try_files $uri $uri/ /index.php?q=$uri$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
location /blog/ {
root /var/www/blog;
}
}
I getting the below error when I open site.com/blog
404 Not Found
nginx/1.14.0 (Ubuntu)