title: How exactly do I server static files with nginx and gunicorn for a Django app?
body: <p>Right now, I'm trying to follow this tutorial:</p>
  
  <p><a href="http://honza.ca/2011/05/deploying-django-with-nginx-and-gunicorn" rel="noreferrer">http://honza.ca/2011/05/deploying-django-with-nginx-and-gunicorn</a></p>
  
  <p>The template site loads correctly, but the images don't load. Here is part of my config.py file for my application:</p>
  
  <pre><code># Absolute filesystem path to the directory that will hold user-uploaded files.
  # Example: "/home/media/media.lawrence.com/media/"
  MEDIA_ROOT = ''
  
  # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  # trailing slash.
  # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  MEDIA_URL = ''
  
  # Absolute path to the directory static files should be collected to.
  # Don't put anything in this directory yourself; store your static files
  # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  # Example: "/home/media/media.lawrence.com/static/"
  STATIC_ROOT = '/home/lilo/textImageSite/imageSite/static/' 
  
  # URL prefix for static files.
  # Example: "http://media.lawrence.com/static/"
  STATIC_URL = '/static/' 
  
  # Additional locations of static files
  STATICFILES_DIRS = (
      # Put strings here, like "/home/html/static" or "C:/www/django/static".
      # Always use forward slashes, even on Windows.
      # Don't forget to use absolute paths, not relative paths.
  )
  </code></pre>
  
  <p>My nginx config file (located at /etc/nginx/sites-enabled):</p>
  
  <pre><code>server {
  listen 80;
  server_name xxx.xx.xx.xx; #the actual IP of the server; it has a public IP address
  
  access_log /home/lilo/textImageSite/access.log;
  error_log /home/lilo/textImageSite/error.log;
  
  location /static {
      root /home/lilo/textImageSite/imageSite;
  }
  
  location / {
      proxy_pass http://127.0.0.1:8888;
  }
  }
  </code></pre>
  
  <p>My gunicorn_conf file:</p>
  
  <pre><code>bind = "0.0.0.0:8888"
  logfile = "/home/lilo/textImageSite/gunicorn.log"
  workers = 3
  </code></pre>
  
  <p>And right now in my template, this is how I'm accessing the image:</p>
  
  <pre><code>&lt;img src="{{STATIC_URL}}{{ choice.image_location}}" /&gt; &lt;br /&gt;
  </code></pre>
  
  <p>Here is what the generated HTML looks like:</p>
  
  <pre><code>&lt;img src="/static/street_sign2.jpg" /&gt; &lt;br /&gt;
  </code></pre>
  
  <p>Sorry for the wall of text, but I can't figure out what's wrong with my setup... </p>