国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > php开源 > 综合技术 > Nginx 重启命令 使用-s参数很简单

Nginx 重启命令 使用-s参数很简单

来源:程序员人生   发布时间:2014-04-29 08:52:48 阅读次数:4220次

最近我的多个VPS经常出现502错误,经常需要重启nginx,但网上的很多教程都需要繁琐的启动脚本,远不如apache的重启命令那么简单。
但研究了一下nginx帮助后发现,有-s参数可对nginx服务进行管理:

# /usr/local/nginx/sbin/nginx -h
nginx version: nginx/0.7.63
Usage: nginx [-?hvVt] [-s signal] [-c filename] [-p prefix] [-g directives]

Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-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

于是我执行
# /usr/local/nginx/sbin/nginx -s reload
nginx已经重启成功

生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生