Passing Proxy Information in Headers


ProxyPreserveHost on


When Apache is acting as a reverse proxy, the Host: header is modified in the proxy request to match the hostname specified in the ProxyPass directive. The original Host: header is placed in another header, X-ForwardedHost. In certain situations, it is desirable to preserve the original value of the header. This can be done by setting ProxyPreserveHost on in the configuration file.

Certain information about the request gets lost when a reverse proxy is in place. The reverse proxy records some of that information in new headers that are added to the request to the backend server:

  • X-Forwarded-For: IP address or hostname of the client

  • X-Forwarded-Host: Original host requested

  • X-Forwarded-Server: Hostname for the proxy server

You can pass additional information using the Header and RequestHeader directives, as shown in the next section.




Apache(c) Phrase Book(c) Essential Code and Commands
Apache Phrasebook
ISBN: 0672328364
EAN: 2147483647
Year: 2006
Pages: 254

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net