[Django]-Bad gateway on django+gunicorn+nginx configuration

5👍

The proxy_pass directive in your nginx server configuration should reflect the upstream server you configured.

proxy_pass http://pzw_server;

http://wiki.nginx.org/HttpUpstreamModule

2👍

xaxes,

Whenever you set your TEMPLATE_DEBUG to False, you also need to set ALLOWED_HOSTS so that Django knows which hosts/domains to process requests for. Apparently, the localhost works implicitly when ALLOWED_HOSTS is just the empty list.

I hope this helps!

Leave a comment