I have setup an nginx + php + wordpress site at www.example.com When I go to example.com on my browseer I see my wordpress blog as I expect and can work with it flawlessly, no problem there. But now I wanted to keep using nginx for other webapps without losing the blog.
Ningx content root is at /srv/www/html
Wordpress root is at /srv/www/wordpress/public_html
I wanted to for example create /srv/www/newsite and drop some webapp in there and be able to access it through example.com/newsite, is that possible?
I tried creating the equivalent in sites-available with the following content:
server {
server_name example.com/newsite www.example.com/newsite;
access_log /srv/www/newsite/logs/access.log;
error_log /srv/www/newsite/logs/error.log;
root /srv/www/newsite;
but it gives me a wordpress page-not-found.
Just to be clear, I want to keep wordpress the way it is now, I want example.com to show me worpdress by default. I just want example.com/newsite to be able to serve its own files.
Instead of declaring a separate server block, within your example.com server block for wordpress, you can open a new location block, like so: