I\'ve tried so many different things. The point I\'m at right now is this:
location ^~ /wordpress {
alias /var/www/example.com/wordpress;
index index
I had the same problem and this is what fixed it for me:
Open the NGINX configuration file for your site. Inside of the server block, add the path to your root directory and set the priority order for files:
root /mnt/www/www.domainname.com;
index index.php index.html index.htm;
Create an empty location block before all your other location blocks:
location /latest {
# Nothing in here; this is to avoid redirecting for this location
}
Commend out the root directory in your location / block and add the redirection so it looks like this:
location / {
# root /mnt/www/www.domainname.com;
index index.php index.html index.htm;
rewrite ^/(.*)$ http://www.domainname.com/latest/$1 redirect;
}
Make sure that your location ~ .php$ block points its root to
root /mnt/www/www.domainname.com;
This fixed it for me.