To configure Nginx for WordPress permalinks, you will need to perform the following steps:
Edit the Nginx configuration file for your WordPress site, usually located at /etc/nginx/sites-available/<sitename>
.
Add the following lines to the configuration file, replacing <sitename>
with the name of your site:
location / { try_files $uri $uri/ /index.php?$args; }
Save the changes to the configuration file and exit the text editor.
Test the configuration file for syntax errors by running the following command:
sudo nginx -t
sudo systemctl reload nginx
Log in to the WordPress admin dashboard and go to the "Settings" > "Permalinks" page.
Select the permalink structure you want to use and save the changes.
Test the permalinks by accessing a post or page using the new permalink structure.