• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Nginx Config File rebuilds after server reboot

tareknassar

New Pleskian
Server operating system version
Ubuntu 20.04 x64
Plesk version and microupdate number
Obsidian 18.0.46
Hello,

I am receiving the following issue on a wordpress website hosted on Plesk SE

cURL error 7: Failed to connect to mydomain.com port 443: Connection refused (http_request_failed)

after investigating the issue and with the help of some technical support we were able to resolve the issue by modifying the Nginx Config file from Plesk Terminal. However, once the server reboots the config files are rebuilt to the original state and all changes are reverted. Nginx creates a .bak file with the changes and loads the original file.

Any thoughts on how to modify the config file without having the changes revert back upon reboot.

thank you.
 
What about adding your modifications through "Additional nginx directives" in "Apache & nginx Settings" of your domain?
 
What about adding your modifications through "Additional nginx directives" in "Apache & nginx Settings" of your domain?
Can you explain more, I am not a very technical person and I will give your reply to someone who is so they can work on it.

thank you.
 
Any thoughts on how to modify the config file without having the changes revert back upon reboot.
Depending on the type of change in configuraton you can either

- add an "add-in" configuration file into the /etc/nginx/conf.d directory (this will not work for instructions that need to go into a "server { ... }" bracket)

or

- as @IgorG said login into Plesk GUI with your admin user, go the subscription, click on "Hosting & DNS" > "Apache & nginx settings", scroll down to the "Additional nginx directives" and copy your code into that field then store the new configuration with "OK" or "Apply".

The first will be included in the Nginx configuration even if the general Nginx configuration file is replaced upon reboot, because Nginx scans the conf.d directory for inclusions. That's what this directory is for. The later will create an individual virtualhost configuration for the domain which will not be replaced by a default upon reboot either. The later is the preferred solution.
 
Back
Top