Browse Source

Touch up proxying docs.

pull/417/merge
Ron DuPlain 13 years ago
parent
commit
9ab41edbd7
  1. 17
      docs/deploying/wsgi-standalone.rst

17
docs/deploying/wsgi-standalone.rst

@ -80,7 +80,9 @@ setups, but you might want to write your own WSGI middleware for specific
setups.
Here's a simple nginx configuration which proxies to an application served on
localhost at port 8000, setting appropriate headers::
localhost at port 8000, setting appropriate headers:
.. sourcecode:: nginx
server {
listen 80;
@ -100,15 +102,18 @@ localhost at port 8000, setting appropriate headers::
}
}
The most common setup invokes the host being set from `X-Forwarded-Host`
and the remote address from `X-Forwarded-For`::
If your httpd is not providing these headers, the most common setup invokes the
host being set from `X-Forwarded-Host` and the remote address from
`X-Forwarded-For`::
from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
Please keep in mind that it is a security issue to use such a middleware
in a non-proxy setup because it will blindly trust the incoming
headers which might be forged by malicious clients.
.. admonition:: Trusting Headers
Please keep in mind that it is a security issue to use such a middleware in
a non-proxy setup because it will blindly trust the incoming headers which
might be forged by malicious clients.
If you want to rewrite the headers from another header, you might want to
use a fixer like this::

Loading…
Cancel
Save