title: How can I get public ip address in Django with Nginx as http server and gunicorn?
body: <p>I want to get public IP address of clients but I just get 127.0.0.1 almost always.
  I tested some solution, but no right answer found with my configuration (Django, Nginx and Gunicorn)</p>
  
  <p>Here is my Nginx proxy config.</p>
  
  <pre><code>location / {
          proxy_pass http://127.0.0.1:8000;
          proxy_set_header Host $http_host;
          proxy_redirect off;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $remote_addr;
          proxy_set_header X-Forwarded-Proto $scheme;
  }
  </code></pre>