title: REMOTE_ADDR not getting sent to Django using nginx & tornado
body: <p>So I got a simple setup with nginx for static media and load balancing and tornado as webserver for django (4 servers running). My problem is remote_addr not getting passed on to django so I'm getting a KeyError:</p>
  
  <p><code>article.ip = request.META['REMOTE_ADDR']</code></p>
  
  <p>The remote address is getting sent through as X-Real-IP (HTTP_X_REAL_IP) thanks to the nginx.conf:</p>
  
  <pre><code>    location / {
          proxy_pass_header Server;
          proxy_set_header Host $http_host;
          proxy_redirect false;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Scheme $scheme;
          proxy_pass http://frontends;
      }
  </code></pre>
  
  <p>As HTTP is prepended to the META key I can't just do proxy_set_header remote_addr $remote_addr. What I could do is read the X-Real-IP if no remote addr key is found but I'm curious if there's a smarter solution.</p>
  
  <p>Thanks!</p>