title: Missing custom header with django, nginx and gunicorn
body: <p>Disclaimer:</p>
  
  <p>I'm working in a project where exist an "huge" webapp that have an api for mobiles, so change the api is not an option.</p>
  
  <p>This application was developed time ago and several developers have worked on it, </p>
  
  <p>Having said that, the problem is this;</p>
  
  <p>In the api for mobile of this site (just views than returns json data), the code is looking for a token but does in the headers of request:</p>
  
  <pre><code>token = request.META.get('HTTP_TOKEN')
  </code></pre>
  
  <p>When I test this api locally, works fine, but in production doesn't, so, I try to figure out whats going on and found this:</p>
  
  <p>django converts headers, even custom headers to keys in request.META, I use urllib2 and  <a href="http://readthedocs.org/docs/requests/en/latest/" rel="noreferrer">requests</a> for test the api and the problem in production is that in production server the request.META never has a key called HTTP_TOKEN, so, doing a little of debug I seriously think the problem is the way we serve the django application.</p>
  
  <p>We are using django1.3, nginx, gunicorn, virtualenvwrapper, python2.7.</p>
  
  <p>My prime suspect is nginx, I think, in someway nginx receive the header but don' forward it to django, I try to do some research about this, but I only found infor about security headers and custom headers from nginx, but I dont find doc or something about how to tell nginx that allows that header and don't remove it.</p>
  
  <p>I need help here, the first thing is test if nginx receives the header, but I just know a little about nginx and I don't know how to tell it to log the headers of requests.</p>
  
  <p>Thanks</p>
  
  <p><strong>Update</strong></p>
  
  <p><a href="http://dpaste.com/hold/652805/" rel="noreferrer">nginx conf file</a></p>