How to configure Nginx for Wordpress permalinks


#1

Originally published at: https://www.cyberciti.biz/faq/how-to-configure-nginx-for-wordpress-permalinks/

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?


#2

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)

Thanks


#3

@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.