快速停止或关闭Nginx:nginx -s stop
正常停止或关闭Nginx:nginx -s quit
修改了配置文件后最好先检查一下修改过的配置文件是否正确,以免重启后Nginx出现错误影响服务器稳定运行。 判断Nginx配置是否正确命令如下:检查配置文件是否正确
/usr/nginx -t 指定配置文件 nginx -c /usr/nginx/conf/nginx.conf 检查指定配置文件 nginx -t -c /usr/nginx/conf/nginx.conf 查看 Nginx 的版本信息的参数 nginx -v 详细的版本信息 nginx -V 显示帮助信息 nginx -h 附: Options: -?,-h : this help -v : show version and exit -V : show version and configure options then exit -t : test configuration and exit -q : suppress non-error messages during configuration testing -s signal : send signal to a master process: stop, quit, reopen, reload -p prefix : set prefix path (default: /usr/local/nginx/) -c filename : set configuration file (default: conf/nginx.conf) -g directives : set global directives out of configuration file