]> granicus.if.org Git - apache/commitdiff
Docuemnt the x- headers added by mod_proxy_http.
authorJoshua Slive <slive@apache.org>
Tue, 31 Jul 2007 20:13:50 +0000 (20:13 +0000)
committerJoshua Slive <slive@apache.org>
Tue, 31 Jul 2007 20:13:50 +0000 (20:13 +0000)
PR: 41097

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@561477 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_proxy.html.en
docs/manual/mod/mod_proxy.xml

index 8b7e47f7eadb9487dd8031fdbfd3e4ef0a583fa6..886ca4acd9bbf541de0abbca075ccc2b0b4653b1 100644 (file)
@@ -96,6 +96,7 @@
 <li><img alt="" src="../images/down.gif" /> <a href="#intranet">Intranet Proxy</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#envsettings">Protocol Adjustments</a></li>
 <li><img alt="" src="../images/down.gif" /> <a href="#request-bodies">Request Bodys</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#x-headers">Reverse Proxy Request Headers</a></li>
 </ul><h3>See also</h3>
 <ul class="seealso">
 <li><code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code></li>
     <code>proxy-sendchunked</code> minimizes resource usage by using
     chunked encoding.</p>
 
-    </div>
+    </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="x-headers" id="x-headers">Reverse Proxy Request Headers</a></h2>
+
+    <p>When acting in a reverse-proxy mode (using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive, for example),
+    <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code> adds several request headers in
+    order to pass information to the origin server. These headers
+    are:</p>
+
+    <dl>
+      <dt><code>X-Forwarded-For</code></dt>
+      <dd>The IP address of the client.</dd>
+      <dt><code>X-Forwarded-Host</code></dt>
+      <dd>The original host requested by the client in the <code>Host</code> 
+       HTTP request ehader.</dd>
+      <dt><code>X-Forwarded-Server</code></dt>
+      <dd>The hostname of the proxy server.</dd>
+    </dl>
+
+    <p>Be careful when using these headers on the origin server, since
+    they will contain more than one (comma-separated) value if the
+    original request already contained one of these headers. For
+    example, you can use <code>%{X-Forwarded-For}i</code> in the log
+    format string of the origin server to log the original clients IP
+    address, but you may get more than one address if the request
+    passes through several proxies.</p>
+
+    <p>See also the <code class="directive"><a href="#proxypreservehost">ProxyPreserveHost</a></code> and <code class="directive"><a href="#proxyvia">ProxyVia</a></code> directives, which control
+    other request headers.</p>
+
+   </div>
 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 <div class="directive-section"><h2><a name="AllowCONNECT" id="AllowCONNECT">AllowCONNECT</a> <a name="allowconnect" id="allowconnect">Directive</a></h2>
 <table class="directive">
index 8dd7d3ef5fb77e4e94bc901cfe96ecf650409079..34c795ae402d6c76cc5f60e7eb5c4ac3af17f22e 100644 (file)
 
     </section> <!-- /request-bodies -->
 
+    <section id="x-headers"><title>Reverse Proxy Request Headers</title>
+
+    <p>When acting in a reverse-proxy mode (using the <directive
+    module="mod_proxy">ProxyPass</directive> directive, for example),
+    <module>mod_proxy_http</module> adds several request headers in
+    order to pass information to the origin server. These headers
+    are:</p>
+
+    <dl>
+      <dt><code>X-Forwarded-For</code></dt>
+      <dd>The IP address of the client.</dd>
+      <dt><code>X-Forwarded-Host</code></dt>
+      <dd>The original host requested by the client in the <code>Host</code> 
+       HTTP request ehader.</dd>
+      <dt><code>X-Forwarded-Server</code></dt>
+      <dd>The hostname of the proxy server.</dd>
+    </dl>
+
+    <p>Be careful when using these headers on the origin server, since
+    they will contain more than one (comma-separated) value if the
+    original request already contained one of these headers. For
+    example, you can use <code>%{X-Forwarded-For}i</code> in the log
+    format string of the origin server to log the original clients IP
+    address, but you may get more than one address if the request
+    passes through several proxies.</p>
+
+    <p>See also the <directive
+    module="mod_proxy">ProxyPreserveHost</directive> and <directive
+    module="mod_proxy">ProxyVia</directive> directives, which control
+    other request headers.</p>
+
+   </section> <!--/x-headers -->
+
+
 <directivesynopsis type="section">
 <name>Proxy</name>
 <description>Container for directives applied to proxied resources</description>