You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sl...@apache.org on 2007/07/31 22:13:51 UTC

svn commit: r561477 - in /httpd/httpd/trunk/docs/manual/mod: mod_proxy.html.en mod_proxy.xml

Author: slive
Date: Tue Jul 31 13:13:50 2007
New Revision: 561477

URL: http://svn.apache.org/viewvc?view=rev&rev=561477
Log:
Docuemnt the x- headers added by mod_proxy_http.

PR: 41097

Modified:
    httpd/httpd/trunk/docs/manual/mod/mod_proxy.html.en
    httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml

Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_proxy.html.en?view=diff&rev=561477&r1=561476&r2=561477
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_proxy.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_proxy.html.en Tue Jul 31 13:13:50 2007
@@ -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>
@@ -286,7 +287,37 @@
     <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">

Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml?view=diff&rev=561477&r1=561476&r2=561477
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml Tue Jul 31 13:13:50 2007
@@ -262,6 +262,40 @@
 
     </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>



Re: svn commit: r561477 - in /httpd/httpd/trunk/docs/manual/mod: mod_proxy.html.en mod_proxy.xml

Posted by Vincent Bray <no...@gmail.com>.
On 01/08/07, Vincent Bray <no...@gmail.com> wrote:
> s/ehader/header/

D'oh! Wrong. List. Sorry.

-- 
noodl

Re: svn commit: r561477 - in /httpd/httpd/trunk/docs/manual/mod: mod_proxy.html.en mod_proxy.xml

Posted by Vincent Bray <no...@gmail.com>.
On 01/08/07, slive@apache.org <sl...@apache.org> wrote:
> Author: slive
> Date: Tue Jul 31 13:13:50 2007
> New Revision: 561477
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=561477
> Log:
> Docuemnt the x- headers added by mod_proxy_http.
>
> PR: 41097
>
> Modified:
>     httpd/httpd/trunk/docs/manual/mod/mod_proxy.html.en
>     httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml

> Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
> +      <dd>The original host requested by the client in the <code>Host</code>
> +       HTTP request ehader.</dd>

s/ehader/header/

Also, for consistency, should the argument to RewriteOptions in your
earlier patch regarding vhosts be capitalised like RewriteOptions
Inherit rather than RewriteOptions inherit? It's a small matter, but
these things get cargo-culted and lead to the current belief that
'require' should always be lowercase :(

-- 
noodl