How to configure the Nginx for WordPress permalinks to work?

If you are using Nginx server for your WordPress website, it will be very easy way to change the URL rewrite configuration in Nginx server.

1. Edit your Nginx conf file with vi command as below.

$ sudo vi /etc/nginx/sites-enabled/<your-domain-name>

2. Look for server block in the config file and change the location.

 location / {
             try_files $uri $uri/ =404;  
             try_files $uri $uri/ /index.php?$args; 
 } 

3. Save and close the config file.

4. Reload the Nginx

$ sudo systemctl reload nginx

That’s it. I hope this will help. 🙂
Photo: Internet

Leave a Reply

Your email address will not be published.