• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Vhosts nginx configuration misconfiguration for wordpress? (add index.html to pathname)

blueberry

Basic Pleskian
Hi,
After installing wordpress and disabling Apache, I have found that while URLs are accessible it returns an error in the Nginx error logs.
For some reasons, the code add the index file at the end of the URI. Here is a log example returned after visiting
Code:
https://inadoo.com/cest-un-nombre/
// As you can see Nginx look for the URI and add the first index file at the end of it.

1602530472336.png
The system also return a proper 200, that's why we don't see it. In other words, everytime I access a URL on a nginx only installation, I get a 200 and also an error recorded in the Nginx error log. I guess the problem is located at /etc/nginx/plesk.conf.d/vhosts/xxxx.com.conf where the nginx directives are located.

I have not added anything to the Nginx additional directives.
 
Last edited:
thank you

so I added
1602562317856.png
then I called the URL
1602562527225.png
And unfortunately, after visiting the logs, the problem is still there. and by the way, it happens with all my domains using nginx on my server.
1602562484235.png

Here is how to repeat the problem:
1. Install wordpress on a domain using Plesk
2. Disable Apache by unchecking Proxy mode in the category "Apache & nginx settings.
3. In wordpress administration, settinbgs>permalinks : set to permalink /sample-post/
3. visit a URL of the website
4. Checks the logs, for a visited URL you should see two entry, 1 file not found error and one 200 for the access
 
Last edited:
Problem was solved by adding

if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php;
}

At the end of nginx additional settings
 
Last edited:
If you want to add other regex directives with it, you must add the following:
Code:
location / {

#add location regex here



location ~* "^/(.+)(!wp-admin|wp-login|wp-content|wp-includes)/$" {
        if (!-e $request_filename) {
            rewrite ^/(.+)/$ /index.php last;
        }
    }


}
 
Back
Top