title: Bad request 400: nginx / gunicorn
body: <p>I have followed this tutorial: <a href="http://blog.wercker.com/2013/11/25/django-16-part3.html" rel="noreferrer">http://blog.wercker.com/2013/11/25/django-16-part3.html</a> and I am just trying to make it work locally with Vagrant for now.  I am not trying to use Wercker.</p>
  
  <p>After everything is installed, I try to access the website but I get a <strong>Bad Request (400)</strong> error every time.  I do not know if that is due to a problem in nginx or in gunicorn.</p>
  
  <p>They both have a log entry so at least I know that the request goes all the way through gunicorn and is not stopped at the nginx level.  </p>
  
  <p>Where is the problem located?  Gunicorn?  nginx?</p>
  
  <p>Here are the logs of gunicorn and nginx.</p>
  
  <p>I see that the favicon is missing but that only should not stop the page from being displayed right?</p>
  
  <p>Gunicorn:</p>
  
  <pre><code> &gt;&gt;&gt; cat /var/local/sites/hellocities/run/gunicorn.error.log
  10.0.0.1 - - [28/Jan/2014:07:05:16] "GET / HTTP/1.0" 400 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36"
  10.0.0.1 - - [28/Jan/2014:07:09:43] "GET / HTTP/1.0" 400 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36"
  </code></pre>
  
  <p>Nginx:</p>
  
  <pre><code>&gt;&gt;&gt; cat /var/log/nginx/hellocities-access.log
  10.0.0.1 - - [28/Jan/2014:07:05:16 +0000] "GET / HTTP/1.1" 400 37 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36"
  10.0.0.1 - - [28/Jan/2014:07:05:20 +0000] "GET /favicon.ico HTTP/1.1" 404 200 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36"
  10.0.0.1 - - [28/Jan/2014:07:09:43 +0000] "GET / HTTP/1.1" 400 37 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36"
  10.0.0.1 - - [28/Jan/2014:07:09:44 +0000] "GET /favicon.ico HTTP/1.1" 404 200 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36"
  
  &gt;&gt;&gt; cat /var/log/nginx/hellocities-error.log
  2014/01/28 07:05:20 [error] 13886#0: *1 open() "/var/local/sites/hellocities/static/favicon.ico" failed (2: No such file or directory), client: 10.0.0.1, server: _, request: "GET /favicon.ico HTTP/1.1", host: "10.0.0.200"
  2014/01/28 07:09:44 [error] 13886#0: *3 open() "/var/local/sites/hellocities/static/favicon.ico" failed (2: No such file or directory), client: 10.0.0.1, server: _, request: "GET /favicon.ico HTTP/1.1", host: "10.0.0.200"
  </code></pre>