Home > Article > Operation and Maintenance > Introduction to common nginx commands
nginx common commands:
View version number
nginx -v
View nginx compiled parameters
nginx -V
Restart gracefully and reload Enter the configuration file
nginx.conf/usr/local/nginx/sbin/nginx -s reload
Stop nginx gracefully. When there is a connection, it will wait for the connection request to complete before killing the worker process
/usr/local/nginx/sbin/nginx -s quit
The specific commonly used commands are as follows:
nginx -s stop 快速关闭Nginx,可能不保存相关信息,并迅速终止web服务。 nginx -s quit 平稳关闭Nginx,保存相关信息,有安排的结束web服务。 nginx -s reload 因改变了Nginx相关配置,需要重新加载配置而重载。 nginx -s reopen 重新打开日志文件。 nginx -c filename 为 Nginx 指定一个配置文件,来代替缺省的。 nginx -t 不运行,仅测试配置文件。nginx 将检查配置文件的语法的正确性,并尝试打开配置文件中所引用到的文件。 nginx -v 显示 nginx 的版本。 nginx -V 显示 nginx 的版本,编译器版本和配置参数。
At the same time, Note that there is no nginx -s start
command in nginx.
Recommended tutorial: nginx tutorial
The above is the detailed content of Introduction to common nginx commands. For more information, please follow other related articles on the PHP Chinese website!