If you are using WordPress on Apache (with mod_rewrite), WordPress will automatically add the required rewrite rules to your .htaccess file for permalinks to work. But for nginx, you have to add the rules manually.
Before applying this WordPress Nginx Permalinks Rewrite you need to make sure you change your permalink structure from “Day and Name” to “Post name” in WordPress dashboard.
Here’s step-by-step changes WordPress pretty permalinks with Nginx:
Add the following Nginx rewrite rule in your vhost:
After you have finished making the changes in the configuration file, reload the nginx configuration:
WordPress’ pretty permalinks should work fine now.
Congratulation’s! You have successfully configure wordpress permalink. Thanks for using this tutorial for configuring wordpress permalink with nginx in CentOS system. For additional help or useful information, we recommend you to check the official Nginx web site.