title: Nginx shows 404 and the logs are clean
body: <p>I'm trying to deploy a django application to AWS EC2 instance using Gunicorn &amp; nginx. I followed <a href="http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/" rel="nofollow">this</a> tutorial because it worked for me last time, but now it's not.</p>
  
  <p>I always get 404 response, even on static files.</p>
  
  <p><strong>Supervisor script:</strong></p>
  
  <pre><code>[program:django]
  command = /home/ubuntu/bin/gunicorn_start
  user = ubuntu
  stdout_logfile = /home/ubuntu/logs/gunicorn_supervisor.log
  redirect_stderr = true
  environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8
  </code></pre>
  
  <p><strong>gunicorn_start:</strong></p>
  
  <pre><code>#!/bin/bash
  
  NAME="django"
  DJANGODIR=/home/ubuntu/django_project
  SOCKFILE=/home/ubuntu/run/gunicorn.sock
  USER=ubuntu
  NUM_WORKERS=3
  DJANGO_SETTINGS_MODULE=django_project.settings
  DJANGO_WSGI_MODULE=django_project.wsgi
  
  echo "Starting $NAME as `whoami`"
  
  cd $DJANGODIR
  export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
  export PYTHONPATH=$DJANGODIR:$PYTHONPATH
  
  RUNDIR=$(dirname $SOCKFILE)
  test -d $RUNDIR || mkdir -p $RUNDIR
  
  exec gunicorn ${DJANGO_WSGI_MODULE}:application \
  --name $NAME \
  --workers $NUM_WORKERS \
  --user=$USER \
  --bind=unix:$SOCKFILE \
  --log-level=debug \
  --log-file=-
  </code></pre>
  
  <p><strong>Nginx Configuration:</strong></p>
  
  <pre><code>upstream django_server {
      server unix:/home/ubuntu/run/gunicorn.sock fail_timeout=0;
  }
  
  server {
      listen 80;
      server_name _;
  
      client_max_body_size 4G;
  
      access_log /home/ubuntu/logs/nginx-access.log;
      error_log /home/ubuntu/logs/nginx-error.log;
  
      location /static/ {
          alias /home/ubuntu/django_project/static_root/;
      }
      location /media/ {
          alias /home/ubuntu/django_project/media/;
      }
      location / {
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxt_set_header Host $http_host;
          proxy_redirect off;
          proxy_pass http://applify_server;
      }
  
      error_page 500 502 503 v504 /500.html;
      location = /500.html {
          root /home/ubuntu/django_project/static_root/;
      }
  }
  </code></pre>
  
  <p>The nginx logs are empty, and the supervisor log don't show any errors. The same applies to nginx access logs and error logs! Nginx is being run as root. A DNS record has not yet being created. The site is being accessed with it's IP.</p>