重啟或殺掉Nginx進程后丟失nginx.pid的解決辦法
安裝SSL證書時,強行殺掉了Nginx的進程,就再也沒起來:
Restarting nginx daemon: nginxcat: /usr/local/nginx/logs/nginx.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec … or kill -l [sigspec]
nginx not running.
原因分析:
nginx.pid丟掉了
如何找回:
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)
運行命令:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/vhost/jb51.net.conf
此時,nginx已可以正常啟動了。
相關文章
Nginx 配置反向代理使用 Google fonts 字體并開啟 HTTP2/SSL 支持
nginx作為web服務器一個重要的功能就是反向代理。當然你也可以使用nginx配置正向代理,本是介紹如何配置nginx的反向代理。nginx反向代理的指令不需要新增額外的模塊,默認自帶proxy_pass指令,只需要修改配置文件就可以實現(xiàn)反向代理。2017-04-04Nginx配置的rewrite編寫時last與break的區(qū)別分析
這篇文章主要介紹了Nginx配置的rewrite編寫時last與break的區(qū)別分析,簡單來說使用last會對server標簽重新發(fā)起請求,而break就直接使用當前的location中的數(shù)據(jù)源來訪問,需要的朋友可以參考下2016-01-01Nginx+Tomcat負載均衡及動靜分離群集的實現(xiàn)
本文主要介紹了Nginx+Tomcat負載均衡及動靜分離群集的實現(xiàn),文中通過示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2022-02-02503 service unavailable錯誤解決方案講解
這篇文章主要介紹了503 service unavailable錯誤解決方案講解,本篇文章通過簡要的案例,講解了該項技術(shù)的了解與使用,以下就是詳細內(nèi)容,需要的朋友可以參考下2021-08-08