title: django+nginx+uwsgi 404 on static files
body: <p>I have a django app, using nginx and uwsgi to serve it. My static files return a 404. I have set ownership of the files to correspond to the nginx username. The path to the static folder was copied directly from terminal, and I ran collectstatic (the static files are successfully served via the django development server). I have also run </p>
  
  <pre><code>chown -R username:username /home 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>chmod -R ug+r /home 
  </code></pre>
  
  <p>I have tried both alias and root. </p>
  
  <p>STATIC_ROOT is in my settings.py</p>
  
  <pre><code>STATIC_ROOT = os.path.join(BASE_DIR, "static/")
  </code></pre>
  
  <p>Here is my nginx.conf:</p>
  
  <pre><code>user username;  
  worker_processes 1;
  
  events {
  
      worker_connections 1024;
  
  }
  
  http {
  
      sendfile on;
  
      gzip              on;
      gzip_http_version 1.0;
      gzip_proxied      any;
      gzip_min_length   500;
      gzip_disable      "MSIE [1-6]\.";
      gzip_types        text/plain text/xml text/css
                        text/comma-separated-values
                        text/javascript
                        application/x-javascript
                        application/atom+xml;
  
      # Configuration containing list of application servers
      upstream app_servers {
  
          server 127.0.0.1:8080;
          # server 127.0.0.1:8081;
          # ..
          # .
  
      }
  
      # Configuration for Nginx
      server {
  
          # Running port
          listen 80;
  
          # Settings to serve static files 
          location /static/  {
  
              # Example:
              # root /full/path/to/application/static/file/dir;
              alias /home/myapp/myapp/static/;
  
          }
  
          # Serve a static file (ex. favico)
          # outside /static directory
          location = /favico.ico  {
  
              root /app/favico.ico;
  
          }
  
          # Proxy connections to the application servers
          # app_servers
          location / {
  
              proxy_pass         http://app_servers;
              proxy_redirect     off;
              proxy_set_header   Host $host;
              proxy_set_header   X-Real-IP $remote_addr;
              proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header   X-Forwarded-Host $server_name;
  
          }
      }
  } 
  </code></pre>