Home  >  Article  >  Operation and Maintenance  >  What commands can be used to control nginx after it is started?

What commands can be used to control nginx after it is started?

王林
王林forward
2020-06-28 17:32:223182browse

What commands can be used to control nginx after it is started?

After Nginx is started, you can use the following command to control:

(Recommended tutorial: nginx tutorial)

nginx -s

Among them- s means to send a signal to the main process. signal can be one of the following four:

stop — Quick shutdown

quit — Elegant Close

reload — Reload the configuration file

reopen — Reopen the log file

When runningnginx - s quit, Nginx will wait for the worker process to complete the current request, and then close it. When you modify the configuration file, it will not take effect immediately. Instead, you will wait for a restart or receive the nginx -s reload signal.

When Nginx receives the nginx -s reload signal, it first checks the syntax of the configuration file. After the syntax is correct, the main thread will start a new worker thread and send a shutdown signal to the old worker thread. If the syntax is incorrect, the main thread will roll back the changes and continue to use the old configuration. When the worker process receives the shutdown signal from the main process, it will exit after processing the current request.

The above is the detailed content of What commands can be used to control nginx after it is started?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:juejin.im. If there is any infringement, please contact admin@php.cn delete