Skip to content

Commit

Permalink
Fix typo and tweak markup.
Browse files Browse the repository at this point in the history
  • Loading branch information
berkerpeksag committed May 29, 2015
1 parent 3c2533d commit 308f10f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/source/deploy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,20 @@ Gunicorn may come from untrusted proxies or directly from clients since the
application may be tricked into serving SSL-only content over an insecure
connection.

Gunicorn v19 introduced a breaking change concerning how ``REMOTE_ADDR`` is
handled. Previous to Gunicorn v19 this was set to the value of
``X-Forwarded-For`` if recieved from a trusted proxy. However, this was not in
compliance with `RFC 3875 CGI Version 1.1 <http://www.ietf.org/rfc/rfc3875>`_
which is why the ``REMOTE_ADDR`` is now the IP address of **the proxy** and
**not the actual user**. You should instead configure Nginx to send the user's
IP address through the ``X-Forwarded-For`` header like this::
Gunicorn 19 introduced a breaking change concerning how ``REMOTE_ADDR`` is
handled. Previous to Gunicorn 19 this was set to the value of
``X-Forwarded-For`` if received from a trusted proxy. However, this was not in
compliance with :rfc:`3875` which is why the ``REMOTE_ADDR`` is now the IP
address of **the proxy** and **not the actual user**. You should instead
configure Nginx to send the user's IP address through the ``X-Forwarded-For``
header like this::

...
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
...

It is also worth noting that the ``REMOTE_ADDR`` will be completely empty if you
bind Gunicorn to a unix socket and not a tcp host:port tuple.
It is also worth noting that the ``REMOTE_ADDR`` will be completely empty if
you bind Gunicorn to a UNIX socket and not a TCP ``host:port`` tuple.

Using Virtualenv
================
Expand Down

0 comments on commit 308f10f

Please sign in to comment.