I am deploying a django webapp on digitalocean and I am using Nginx and Gunicorn.
And when I open my url, it shows 502 bad gateway.
In the nginx_errors.log, I find the following error message:
[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"
Is it because my nginx configuration is wrong? How to fix it?