一开始百度解决该问题。只是找到几个求助答案。没有实际有效的方法,于是用google开始搜索,一般,英文网站上总会有解决方法这一次也不另外。
issued a nginx -s stop and after that I got this error when trying to reload it.
[error]: invalid PID number "" in "/var/run/nginx.pid"
That /var/run/nginx/pid file is empty atm.
What do I need to do to fix it?
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 -c /path/to/config/file) //在我机器上是这样的/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf