I am a layman in this field. My problem is that my nginx customizations work good for 3 or 4 days then suddenly all the customizations are removed and the configuration is reverted to its previous form. If I update the customization again, it stays for 3, 4 days then again it gets erased and reverted to default.
My Nginx is setup as Reverse Proxy, with PHP-FPM, Redis cache, gzip, HTTP/2
My server is Easyapache4 with WHM/Cpanel
I use the following command to edit and update my nginx configuration:
sudo nano /etc/nginx/conf.d/users/homemadecircuits.conf
I want to ensure that once updated the customizations should remain permanently as is, until I edit them myself.
Any help to solve this issue will be greatly appreciated.
It seems like you are using Nginx in Cpanel. In this case, your Ngnix configuration will be automatically updated based on Cpanl Configuration Cron job.
The reason is that Cpanel support automatic reset function for Nginx configuration for security and consistency and compatibility and etc...
To prevent the automatic update, you need to follow guide of Cpanel Ngnix configuration.
https://docs.cpanel.net/knowledge-base/web-services/nginx-with-reverse-proxy/#overview
Or you can use default configuration file but you can adjust some default configuration parameters such as CPANEL_APACHE_PROXY_PASS.
To do this, you can find the solution here