What is the difference between reload and restart?
Reload: master reads new config, starts new workers, old workers finish requests and shut down. Zero downtime. Restart: stops and starts Nginx. All active connections dropped. Brief downtime. Always use reload for config changes in production.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Updating Nginx Without Downtime Zero-Downtime Configuration Changes
Use sudo systemctl reload nginx (not restart). Reload starts new worker processes with the new config while old workers finish their current requests. No connections are dropped. Always test with nginx -t first, and back up the config before changes.
Master receives SIGHUP, reads new config, starts new workers with new config, sends shutdown signal to old workers, old workers stop accepting new connections but finish current requests, old workers shut down, new workers handle all traffic. Takes milliseconds.
Read the error message it shows the file, line number, and the issue. Fix the error in the config file, then run nginx -t again. Do not reload until the test passes. A failed config could cause Nginx to stop accepting connections.
Still have questions?
Browse all our FAQs or reach out to our support team
