http://blog.51cto.com/ilanni/1763175nginx
/usr/local/nginx/nginx -t -c /usr/nginx/conf/nginx.conf #檢查nginx.conf配置文件
kill -HUP /usr/local/nginx/nginx.pid 或 nginx -s reload #平滑重啓spa
報錯:blog
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)it
或者:sed
nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)配置
解決:file
./nginx -c /usr/local/nginx/conf/nginx.confgrep
./nginx -s reloaderror
找到nginx.pid文件,修改內容爲實際pid配置文件
ps -ef | grep nginx #查看nginx的pid