Reload instead of restart
A reload tells NGINX to read the configuration again. It starts new worker processes and lets the old ones finish their open requests, so visitors normally notice nothing. If the new configuration cannot be applied, NGINX keeps running with the old one. A restart stops the service first, so it interrupts connections, and it may fail to start again if the configuration is wrong.
Back up the file you change
Make a copy next to the file before editing, with the date in its name. Do not leave copies inside a directory that NGINX loads with a wildcard such as conf.d/*.conf or sites-enabled/*, because it would load them too. On Debian and Ubuntu edit the file in sites-available; the entry in sites-enabled is usually only a link to it.
sudo cp -a /etc/nginx/sites-available/example.conf /root/example.conf.$(date +%Y%m%d-%H%M%S)Test, then reload
nginx -t checks the syntax and the files the configuration refers to, such as certificates. Use nginx -T to see the complete configuration after includes. Reload only when the test passes; joining the commands with && does that for you. The test cannot tell whether the configuration does what you intended, so open the website afterwards.
sudo nginx -t && sudo systemctl reload nginx
sudo nginx -T | less
curl -I https://example.com/When something goes wrong
Return the backup copy, test again and reload. If the service stopped, the error log and the journal tell you why. Look for messages about a port that is already in use, a missing certificate or a duplicate server name.
sudo cp -a /root/example.conf.20261031-120000 /etc/nginx/sites-available/example.conf
sudo nginx -t && sudo systemctl reload nginx
sudo journalctl -u nginx -n 50 --no-pager
sudo tail -n 50 /var/log/nginx/error.logWhat a reload does not cover
Long-lived connections such as WebSockets stay with old workers until they end, so old workers can run for a while and use extra memory. A package upgrade may restart the service on its own. Test larger changes on a test server first, including certificates and redirects.
NGINX Manager in CH-J Server Manager
NGINX Manager edits configuration files in the managed NGINX directories on Linux servers, up to 512 KiB per file. When saving, the application makes a backup with a .chj-backup- suffix, runs nginx -t and keeps the change only after a successful test. A reload needs your explicit confirmation and runs the test again before it starts. An enabled symlink is not replaced; edit the matching file in sites-available.