http://blog.51cto.com/ilanni/1763175
/usr/local/nginx/nginx -t -c /usr/nginx/conf/nginx.conf #检查nginx.conf配置文件
kill -HUP /usr/local/nginx/nginx.pid 或 nginx -s reload #平滑重启
报错:
nginx -s reload is only used to tell a running nginx process to reload its config. After a stop, you don't have a running nginx process to send a signal to. Just run nginx (possibly with a -c /path/to/config/file)
或者:
nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
解决:
./nginx -c /usr/local/nginx/conf/nginx.conf
./nginx -s reload
找到nginx.pid文件,修改内容为实际pid
ps -ef | grep nginx #查看nginx的pid