重啟或殺掉Nginx進(jìn)程后丟失nginx.pid的解決辦法
安裝SSL證書時,強(qiáng)行殺掉了Nginx的進(jìn)程,就再也沒起來:
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)
運(yùn)行命令:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/vhost/jb51.net.conf
此時,nginx已可以正常啟動了。
相關(guān)文章
Apache Nginx 禁止目錄執(zhí)行PHP腳本文件的方法
這篇文章主要介紹了Apache Nginx 禁止目錄執(zhí)行PHP腳本文件的方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-06-06
Nginx代理Vue項(xiàng)目出現(xiàn)Invalid Host header問題及解決
在使用Nginx的upstream對Vue項(xiàng)目進(jìn)行負(fù)載均衡時,如果代理地址無法訪問目標(biāo)地址且頁面報錯InvalidHostheader(無效主機(jī)頭),可能是由于Vue項(xiàng)目的主機(jī)檢查配置導(dǎo)致的,解決方法是在Vue項(xiàng)目的webpack.dev.js文件中的devServer下添加disableHostCheck:true,跳過主機(jī)檢查2024-12-12
詳解Nginx服務(wù)器中的nginx.conf配置文件
這篇文章主要介紹了詳解Nginx服務(wù)器中的nginx.conf配置文件,包括對HTTP服務(wù)的基本配置方法,需要的朋友可以參考下2015-08-08
Nginx(PHP/fastcgi)的PATH_INFO問題
PATH_INFO是一個CGI 1.1的標(biāo)準(zhǔn),經(jīng)常用來做為傳參載體. 比如, 我們可以使用PATH_INFO來代替Rewrite來實(shí)現(xiàn)偽靜態(tài)頁面, 另外不少PHP框架也使用PATH_INFO來作為路由載體.2011-08-08
Nginx實(shí)現(xiàn)TCP和UDP代理的方法步驟
Nginx 1.9.13 及以上版本支持TCP/UDP代理功能,通過配置監(jiān)聽端口、后端服務(wù)器地址等參數(shù),實(shí)現(xiàn)客戶端請求的轉(zhuǎn)發(fā)和響應(yīng)的返回,下面就來介紹一下如何實(shí)現(xiàn),感興趣的可以了解一下2024-12-12
Nginx一個域名訪問多個項(xiàng)目的方法實(shí)例
這篇文章主要給大家介紹了關(guān)于Nginx一個域名訪問多個項(xiàng)目的方法,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用Nginx具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧2019-12-12

