簡體   English   中英

Ngnix + Gunicorn + Django configuratoin上的502錯誤網關

[英]502 bad gateway on Ngnix+Gunicorn+Django configuratoin

我正在digitalocean上部署django webapp,並且正在使用Nginx和Gunicorn。

當我打開網址時,它顯示502錯誤的網關。

在nginx_errors.log中,我發現以下錯誤消息:

[error] 12229#0: *1 connect() to unix:/home/demo/webapps/hello/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 123.45.6.78, server: demohello.com, request: "GET / HTTP/1.1", upstream: "http://unix:/home/demo/webapps/hello/run/gunicorn.sock:/", host: "demohello.com"

是否因為我的Nginx配置錯誤? 如何解決?

您需要在/etc/init/gunicorn.conf中正確設置gunicorn的配置。

請注意:

  • --name = django_project \\
  • --pythonpath = django_project \\
  • django_project WSGI:應用

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM