How to configure Nginx for WordPress permalinks

www.‮l‬autturi.com
How to configure Nginx for WordPress permalinks

To configure Nginx for WordPress permalinks, you will need to perform the following steps:

  1. Edit the Nginx configuration file for your WordPress site, usually located at /etc/nginx/sites-available/<sitename>.

  2. Add the following lines to the configuration file, replacing <sitename> with the name of your site:

location / {
    try_files $uri $uri/ /index.php?$args;
}
  1. Save the changes to the configuration file and exit the text editor.

  2. Test the configuration file for syntax errors by running the following command:

sudo nginx -t
  1. If the configuration file is correct, reload Nginx to apply the changes:
sudo systemctl reload nginx
  1. Log in to the WordPress admin dashboard and go to the "Settings" > "Permalinks" page.

  2. Select the permalink structure you want to use and save the changes.

  3. Test the permalinks by accessing a post or page using the new permalink structure.

Created Time:2017-10-28 21:39:00  Author:lautturi