1

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

当我打开我的网址时,它显示 502 bad gateway。

在 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配置不对?如何解决?

4

1 回答 1

0

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

请注意:

  • --name= django_project \
  • --pythonpath= django_project \
  • django_projectwsgi:应用程序
于 2016-01-07T04:18:32.070 回答