Nginx WordPress configurations

This post lists various troubleshooting points for nginx configuration for WordPress.

How to include a custom nginx.conf file

To include a custom nginx.conf file from your public_html or root folder into the main nginx configuration file of your domain in sites-available directory, simply add this line in server directive (under the index lines usually, like this:)

        root /home/navina/public_html;
        index index.html index.htm index.php;
        include /home/your-domain/public_html/nginx.conf;

This is helpful for example when you have custom nginx.conf file configurations from w3 total cache.

Make sure that you restart nginx after making any changes to main or included file, using command:

service nginx restart

Let me know if you have any query.

Leave a Reply

Your email address will not be published. Required fields are marked *