title: How to Configure Django on Gunicorn and Nginx (Mac OS X)
body: <p>I'm trying to set up Django with Nginx + Gunicorn and Supervisor in Lion.
  I have already installed:</p>
  
  <p><strong>Progress</strong>: MySQL DMG + MySQLdb Compile + Python + brew nginx + easy_install gunicorn + pip install Django + easy_install supervisor.</p>
  
  <p><strong>Current configuration details:</strong></p>
  
  <pre><code>Nginx:
  upstream app_server {
       server unix:/tmp/gunicorn.sock fail_timeout=0;
  }
  server {
      listen       80;
      server_name  localhost;
      #Static
      root /Users/andre/sites;
      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;
              break;
          }
      }
  </code></pre>
  
  <p>Gunicorn: You can see <a href="https://github.com/benoitc/gunicorn/blob/master/examples/example_config.py" rel="nofollow">Here</a></p>
  
  <pre><code>Supervisor:
  [program:gunicorn]
  command=/usr/local/bin/gunicorn main:application -c    /Users/devepy/desktop/andre/andre/gunicorn.conf.py
  directory=/Users/andre/desktop/andre/myproject
  user=nobody
  autostart=true
  autorestart=true
  redirect_stderr=True
  </code></pre>
  
  <p>Actually I have no idea what else to do, but it took weeks trying to learn mac osx is crazy.</p>