title: django-gunicorn-nginx: 502 bad gateway
body: <p>I'm trying to ship my web application to the server and this is my first time configuring the server. I'm using <strong>django-gunicorn-nginx</strong> setup by following this tutorial <a href="http://ijcdigital.com/blog/django-gunicorn-and-nginx-setup/">http://ijcdigital.com/blog/django-gunicorn-and-nginx-setup/</a> First everything was perfect and I got the <strong>django welcome page</strong>. Then I loaded the apps in the django project and setup the static root and Now I'm getting <strong>502 bad gateway</strong> You can check out in <a href="http://qlimp.com">http://qlimp.com</a></p>
  
  <p>Everything upto the gunicorn and supervisor setup is the same as shown in that tutorial. But I modified some nginx conf. Here it is:</p>
  
  <pre><code>upstream app_server_djangoapp {
      server localhost:8001 fail_timeout=0;
  }
  
  server {
      listen 80;
      server_name qlimp.com;
  
      access_log  /var/log/nginx/guni-access.log;
      error_log  /var/log/nginx/guni-error.log info;
  
      keepalive_timeout 5;
  
      location / {
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $http_host;
          proxy_redirect off;
          if (!-f $request_filename) {
              proxy_pass http://app_server_djangoapp;
              break;
          }
      }
      location /files/ {
          autoindex on;
          root /home/nirmal/qlimp/qlimp/files/;
      }
  }
  </code></pre>
  
  <p>Here is my Media url:</p>
  
  <pre><code>MEDIA_URL = '/files/'
  </code></pre>
  
  <p>Files is the folder where I'm having all the static files. How can I get my project to work in the server? Could anyone guide me?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Errors.log    <a href="https://gist.github.com/2768425">https://gist.github.com/2768425</a></p>
  
  <p>Thanks!</p>