title: How to configure nginx and uWSGI for Django project
body: <p>I am trying to configure nginx + uWSGI for Django project on local machine..but nginx and uWSGI not interacting with each other..</p>
  
  <p>I have put nginx configuration in <code>/etc/nginx/sites-available/default</code> which is :</p>
  
  <pre><code>    upstream django {
      # connect to this socket
      # server unix:///tmp/uwsgi.sock;    # for a file socket
      server 127.0.0.1:8001;      # for a web port socket
      }
  
  server {
      # the port your site will be served on
      listen      4321;
      # the domain name it will serve for
      server_name localhost;   # substitute your machine's IP address or FQDN
      charset     utf-8;
  
      #Max upload size
      client_max_body_size 75M;   # adjust to taste
  
  
      # Finally, send all non-media requests to the Django server.
      location / {
          uwsgi_pass  django;
          include     /etc/nginx/uwsgi_params; # or the uwsgi_params you installed manually
          }
      }
  </code></pre>
  
  <p>And then i used this command to start uWSGI:</p>
  
  <pre><code>uwsgi --socket 127.0.0.1:8001 --chdir /home/vaibhav/TRAC/coupon-rest-api/couponRestApi/ --wsgi-file couponRestApi/wsgi.py --master --processes 4 --threads 2 --stats 127.0.0.1:9191
  </code></pre>
  
  <p>uWSGI is working but nginx + uWSGI not ..please tell me what i am doing wrong here...</p>
  
  <p>nginx logs:</p>
  
  <pre><code>2013/05/11 11:12:56 [warn] 6563#0: server name "http://localhost/" has suspicious symbols in /etc/nginx/sites-enabled/default:30
  2013/05/11 11:12:56 [emerg] 6563#0: unexpected "}" in /etc/nginx/sites-enabled/default:79
  2013/05/11 11:16:01 [emerg] 8352#0: unexpected "}" in /etc/nginx/sites-enabled/default:79
  </code></pre>
  
  <p>I found the error in the nginx congiguration but now when i open Django admin panel the layout is distorted ...</p>