How to configure Nginx for Wordpress permalinks

Originally published at:

I switched from Apache to Nginx web server. How do I configure permalinks under WordPress blog? How can I configure Nginx for Wordpress permalinks using virtual hosting?


Please give an example of njnx configuration for vps (ex linode) hosting for more than one wordpress sites, for security, permanent links and please mention the names of the configuration files that we have to change, because for ex in your post you mention to change the sites enabled but i cannot change that file (so i changed sites available)


@PanosZ what kind of problems are you having? Usually, you create per domain config in /etc/nginx/sites-available/ directory. Like:

  1. For domain domain-one-com create kbd> /etc/nginx/sites-available/domain-one-com.conf
  2. For domain domain-two-com create kbd> /etc/nginx/sites-available/domain-two-com.conf

Next symlink using the ls command on Linux in /etc/nginx/sites-enabled/ directory:

cd /etc/nginx/sites-enabled/
ln -s /etc/nginx/sites-available/domain-one-com.conf .
ln -s /etc/nginx/sites-available/domain-two-com.conf .

That is all. Restart nginx and it should work.

Amazing solution! Your solution works perfectly. For my sites conf file i went to


instead of the provided url. Maybe you should include it. In the begging i tried changing the default.conf as i was not sure.

Stathis D.