I came upon this thread while searching for this, too, but then I remembered that I already did it on another Wordpress site.
So, to do fix this you need to edit the domain’s Nginx configuration file. If you are a beginner, I wouldn’t suggest doing it because you can break stuff.
For example, your domain is mywordpress.com – what you need to do is login via SSH and open the file /etc/nginx/sites-available/mywordpress.com, and between:
fastcgi_hide_header X-Powered-By;
# enforce NO www
if ($host ~* ^www\.(.*))
{
set $host_without_www $1;
rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
}
# unless the request is for a valid file, send to bootstrap
if (!-e $request_filename)
{
rewrite ^(.+)$ /index.php?q=$1 last;
}
Save the file, restart Nginx, and you should be fine.
It worked for me too; just needed to clean up the formatting a little. I’m brand new to Nginx, so this was a big help.
fastcgi_hide_header X-Powered-By;
enforce NO www
if ($host ~* ^www.(.)) {
set $host_without_www $1;
rewrite ^/(.)$ $scheme://$host_without_www/$1 permanent;
}
unless the request is for a valid file, send to bootstrap
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}