2017-02-21 88 views
0

檢查了一些其他類似的問題在這裏,但無法診斷問題。NGINX - 連接到UNIX襪子失敗

我的網站偶爾會出現502錯誤網關錯誤。

我在我的錯誤日誌中發現了以下內容。注意我在Ubuntu 16.04上使用Gunicorn/NGINX使用VPS服務器。

2017/02/21 01:08:29 [crit] 1247#1247: *1 connect() to unix:/home/django/chrisblog/chrisblog.sock failed (2: No such file or directory) while connecting to upstream, client: 173.48.32.62, server: 45.32.201.31, request: "GET /redditclone/ HTTP/1.1", upstream: "http://unix:/home/django/chrisblog/chrisblog.sock:/redditclone/", host: "pythoncreate.com" 
 
2017/02/21 01:10:36 [crit] 1575#1575: *1 connect() to unix:/home/django/chrisblog/chrisblog.sock failed (2: No such file or directory) while connecting to upstream, client: 173.48.32.62, server: 45.32.201.31, request: "GET/HTTP/1.1", upstream: "http://unix:/home/django/chrisblog/chrisblog.sock:/", host: "pythoncreate.com" 
 
2017/02/21 01:48:04 [crit] 2342#2342: *2 connect() to unix:/home/django/chrisblog/chrisblog.sock failed (2: No such file or directory) while connecting to upstream, client: 173.48.32.62, server: 45.32.201.31, request: "GET/HTTP/1.1", upstream: "http://unix:/home/django/chrisblog/chrisblog.sock:/", host: "pythoncreate.com"

當我去檢查gunicorn狀態我碰到下面的,所以它看起來像它可能失敗因某種原因?:

gunicorn.service - gunicorn daemon 
 
    Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled) 
 
    Active: failed (Result: exit-code) since Tue 2017-02-21 01:46:08 UTC; 7min ago 
 
Main PID: 2245 (code=exited, status=203/EXEC) 
 

 
Feb 21 01:46:08 mydjangoblog systemd[1]: Started gunicorn daemon. 
 
Feb 21 01:46:08 mydjangoblog systemd[1]: gunicorn.service: Main process exited, code=exited, status=203/EXEC 
 
Feb 21 01:46:08 mydjangoblog systemd[1]: gunicorn.service: Unit entered failed state. 
 
Feb 21 01:46:08 mydjangoblog systemd[1]: gunicorn.service: Failed with result 'exit-code'.

這裏是ps aux |的輸出grep的nginx的

root  2341 0.0 0.1 125104 1480 ?  Ss 01:47 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on; 
 
www-data 2342 0.0 0.4 125444 3152 ?  S 01:47 0:00 nginx: worker process 
 
django 2461 0.0 0.2 16576 2000 pts/0 S+ 01:57 0:00 grep --color=auto nginx

這裏任何幫助非常感激

回答

0

你只需要檢查 「/home/django/chrisblog/chrisblog.sock」 是否存在。

相關問題