title: Django, serving static files with nGinx gives error 404
body: <p>I can't serve static files through nGinx and I am getting 404 instead. I can see the error (shown in the error.log), I just can't see how to fix it. </p>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>urlpatterns += patterns('', (
          r'^static/(?P&lt;path&gt;.*)$',
          'django.views.static.serve',
          {'document_root': 'static'}
  ))
  </code></pre>
  
  <p><strong>settings.py</strong></p>
  
  <pre><code>STATIC_ROOT =  os.path.join(PROJECT_DIR, "staticfiles/")
  STATIC_URL = '/static/'
  
  DEBUG=False
  </code></pre>
  
  <p>(did a collectstatic and all static files are now in 'staticfiles/')</p>
  
  <p><strong>nginx configuration</strong></p>
  
  <pre><code>server { 
      listen 80; 
      server_name my_ip;  
      location = /favicon.ico { access_log off; log_not_found off; } 
  
      location /static/ {
          root /home/project/project/project/staticfiles;
      }
  
      location / {
          include proxy_params;
          proxy_pass http://unix:/home/project/project/project.sock;
      }
  }
  </code></pre>
  
  <p><strong>base.html</strong></p>
  
  <pre><code>{% load staticfiles %}
  &lt;link rel="stylesheet" href="{% static '/css/main.css' %}"&gt;
  </code></pre>
  
  <p>and this is the log</p>
  
  <p><strong>error.log</strong></p>
  
  <pre><code>2017/04/09 10:57:40 [error] 4719#4719: *182 open() "/home/project/project/project/staticfiles/static/images/home-lock.png" failed (2: No such file or directory)
  </code></pre>
  
  <p>("static/" is added in the static url and I can't see why)</p>