欧美亚洲_中文字幕在线看_免费污视频_99福利视频_狠狠干天天操_天天做天天干_老女人丨91丨九色_久久视频这里只有精品_超碰成人av_毛片成人_91欧美日韩_青青操影院_俺也去av_亚洲图片一区二区三区_午夜伦理在线观看_天天毛片_久久国产视频精品_成人久久精品人妻一区二区三区

您現在的位置:新疆網站建設-新疆網站制作-新疆二域設計>> 幫助中心>服務器相關>> Nginx服務重啟失敗:Job for nginx.service failed

Nginx服務重啟失敗:Job for nginx.service failed

作者:未知  來源:互聯網  發布時間:2025-08-16 16:36:49  點擊數:0

啟動Nginx服務提示Nginx服務重啟失敗,如下提示:

Job for nginx.service failed because the control process exited with error code. Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journal


問題處理:


首先用命令

命令去校驗你的Nginx配置是否成功:

nginx -t

如果成功,他會給出如下信息:

# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

如果你的配置文件有問題,也能從錯誤信息中看出來:

duplicate default server for [::]:80 in /etc/nginx/nginx.conf:41

錯誤已經很明顯了,有多個配置文件里面使用了80端口。所以你可以用下面這條命令去查找一下:

grep -R default_server /etc/nginx

# 啰嗦一句,-R的意思是遞歸查找。這條命令會從 /etc/nginx下遞歸查找所有包含 default_server 的文件

找到該文件,寫個別的端口或者刪掉沒用的文件,這個錯誤就可以解決了!

查看Nginx服務狀態你可以發現:

# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 2018-11-06 12:31:21 JST; 15s ago
...
11月 06 12:31:20 zhangch-101 nginx[1863]: nginx: [emerg] bind() to 0.0.0.0:5001 failed (98: Address already in use)
11月 06 12:31:21 zhangch-101 systemd[1]: nginx.service: control process exited, code=exited status=1
11月 06 12:31:21 zhangch-101 nginx[1863]: nginx: [emerg] still could not bind()
11月 06 12:31:21 zhangch-101 systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
11月 06 12:31:21 zhangch-101 systemd[1]: Unit nginx.service entered failed state.
11月 06 12:31:21 zhangch-101 systemd[1]: nginx.service failed.


這個錯誤比較明顯,已經有進程占用這個端口了。

這時你就應該去看看哪個進程占用了這個端口:

netstat -nap | grep 5001



關鍵字: 重啟失敗 Nginx

上一篇:完全卸載nginx的詳細步驟
下一篇:windows2019 server如何讓操作系統在指定時間自動重啟?

版權所有 新疆二域信息技術有限公司 All Rights Reserved 地址:烏魯木齊市北京南路高新街217號盈科廣場B座615 備案號:新ICP備14003571號-6 新公網安備 65010402000050號