Nginx for Wordress reverted to original and return 404

Post Reply
shally87
Posts: 11
Joined: Fri Jun 11, 2021 5:04 pm

Hi,

I have 3 server with 1 Vestacp and the other myVestaCp and I am having the same problem for all my server.
I install myVestaCP with nginx + php-fpm and in the server i only run wordpress website.
Following the example from nginx and wordpress, I need to add;

Code: Select all

        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }

        location / {
                # This is cool because no php is touched for static content.
                # include the "?$args" part so non-default permalinks doesn't break when using query string
                try_files $uri $uri/ /index.php?$args;
	}
individually on my wordpress installation so that the permalinks will work.

So what happen was, after few months, the configuration in nginx file (e.g example.com.nginx.conf and example.com.nginx.ssl.conf) will revert to original without the code above.
When this happen my permalinks fail to work and any navigation will send my website to 404 page.

I am wondering if there is a solution to this.

Thanks.
shally87
Posts: 11
Joined: Fri Jun 11, 2021 5:04 pm

Update.
I change the xample.com.nginx.conf and example.com.nginx.ssl.conf by adding the code mentioned earlier for one of my website which runs on myvestacp, and yesterday I realize that it reverted to original which is without the code.
This happen much faster than I thought. So I am wondering if there is any fix? I try to google around but could not find a solution.
shally87
Posts: 11
Joined: Fri Jun 11, 2021 5:04 pm

I try to see if it is related to SSL because the day after my post on 22/2/22, I saw that the SSL certificate file was renewed.
So what I do was, I log in to myvestacp, disable ssl for my website and enable it back. Then the SSL file was renewed including example.com.nginx.ssl.conf.
The root cause is found and I am wondering if you know how I can stop the renewal of SSL from changing the example.com.nginx.ssl.conf file?
I am using letsencrypt so it will be renewed every 90 days.
Post Reply