nginx reload principle

When nginx start, it will start two processes: one is the Master process and worker processes.
After changing the configuration nginx to do
after 1) change the nginx configuration, HUP signal of the signal to be transmitted to the main process.
2) the main process will first detect grammatical validity of the new configuration.
3) attempts to apply the new configuration 1. Open the log file and assign a new socket to listen. 2. If one fails, the rollback change, will still use the original configuration. 1 3. If successful, the new configuration, a new thread. Send a message to a successful close after the new old process. Requirements elegant old thread closed. 4. The old threads will continue to serve after being signal, when the client requests are all services, close the old thread 



 

Reload

nginx -s reload

 

Guess you like

Origin www.cnblogs.com/gcixx/p/11145466.html