I'm trying to configure a website with nginx that serves django on main domain and serves wordpress on doamin.com/blog and my django part works completly fine but in wordpress I have the issue that when I'm trying to reach wordpress's main page (domain.com/blog) it gives me a 403 nginx forbidden error. everything else works fine for example I can access wordpress's dashboard and do everything. even when I try going to a url like domain.com/blog/xx it properly shows a (page not found) page in wordpress which is right. The only problem I have is with domain.com/blog So because my problem is only with wordpress part I only copied the nginx configuration for it
location /blog {
alias /var/www/example.com;
try_files $uri $uri/ @blog;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
}
location @blog {
rewrite /blog/(.*)$ /blog/index.php?/$1 last;
}