Home >Operation and Maintenance >Nginx >How to run and control nginx
/usr/local/nginx in the following commands is the absolute path to the nginx binary.
(Recommended tutorial: nginx tutorial)
1. Start
/usr/local/nginx/sbin/nginx
2. Reopen the log file
/usr/local/nginx/sbin/nginx -s reopen
3. Reload the configuration file
/usr/local/nginx/sbin/nginx -s reload
4. Stop
/usr/local/nginx/sbin/nginx -s stop
5. Stop gracefully
(1) Check the process number
ps -ef|grep nginx
(2) Kill the process
kill -QUIT <进程号> 或 kill -TERM <进程号>
6. Force stop
pkill -9 ngin
The above is the detailed content of How to run and control nginx. For more information, please follow other related articles on the PHP Chinese website!