502 Bad Gateway nginx/1.1.19 on django
<p>I am new to this. I took the image of running django application and spawned the new vm that points to a different database but I am getting this "502 Bad Gateway  nginx/1.1.1"</p>

<p>when i tested this in development mode, it works fine but not otherwise.</p>

<p>i looked into /var/log/nginx/access.log and error.log but nothing found there.
Any help would be appreciated</p>

<p>Error <strong>502 Bad Gateway</strong> means that the NGINX server used to access your site couldn't communicate properly with the <em>upstream server</em> (your application server).</p>

<p>This can mean that either or both of your NGINX server and your Django Application server are configured incorrectly.</p>

<p>Double-check the configuration of your NGINX server to check it's proxying to the correct domain/address of your application server and that it is otherwise configured correctly.</p>

<p>If you're sure this isn't the issue then check the configuration of your application server. Are you able to connect directly to the application server's address? If you are able to log in to the server running the application, you can try <code>localhost:&lt;port&gt;</code> using your app's port number to connect directly. You can try it with <code>curl</code> to see what response code you get back.</p>

python django nginx