Commit e0db7ffe authored by Ralf S. Engelschall's avatar Ralf S. Engelschall
Browse files

Add the ProxyPassReverse directive which allows Apache to be

used as a full-featured Reverse Proxy in front of a backend
webserver cluster.

Submitted by: Ralf S. Engelschall
Reviewed by: Martin Kraemer, Ralf S. Engelschall


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@80296 13f79535-47bb-0310-9956-ffa450edef68
parent b276f3fe
Loading
Loading
Loading
Loading
+66 −0
Changes for docs/manual/mod/mod_proxy.html: 66 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ and other protocols.
<LI><A HREF="#proxyrequests">ProxyRequests</A>
<LI><A HREF="#proxyremote">ProxyRemote</A>
<LI><A HREF="#proxypass">ProxyPass</A>
<LI><A HREF="#proxypassreverse">ProxyPassReverse</A>
<LI><A HREF="#proxyblock">ProxyBlock</A>
<LI><A HREF="#noproxy">NoProxy</A>
<LI><A HREF="#proxydomain">ProxyDomain</A>
@@ -200,6 +201,71 @@ internally converted into a proxy request to

<HR>

<H2><A NAME="proxypassreverse">ProxyPassReverse</A></H2>
<A
 HREF="directive-dict.html#Syntax"
 REL="Help"
><STRONG>Syntax:</STRONG></A> ProxyPassReverse <EM>&lt;path&gt; &lt;url&gt;</EM><BR>
<A
 HREF="directive-dict.html#Default"
 REL="Help"
><STRONG>Default:</STRONG></A> <EM>None</EM><BR>
<A
 HREF="directive-dict.html#Context"
 REL="Help"
><STRONG>Context:</STRONG></A> server config, virtual host<BR>
<A
 HREF="directive-dict.html#Override"
 REL="Help"
><STRONG>Override:</STRONG></A> <EM>Not applicable</EM><BR>
<A
 HREF="directive-dict.html#Status"
 REL="Help"
><STRONG>Status:</STRONG></A> Base<BR>
<A
 HREF="directive-dict.html#Module"
 REL="Help"
><STRONG>Module:</STRONG></A> mod_proxy<BR>
<A
 HREF="directive-dict.html#Compatibility"
 REL="Help"
><STRONG>Compatibility:</STRONG></A> ProxyPassReverse is only available in
Apache 1.3b6 and later.<P>

This directive lets Apache adjust the URL in the <TT>Location</TT> header on
HTTP redirect responses. For instance this is essential when Apache is used as
a reverse proxy to avoid by-passing the reverse proxy because of HTTP
redirects on the backend servers which stay behind the reverse proxy.
<P>
&lt;path&gt; is the name of a local virtual path.<BR>
&lt;url&gt; is a partial URL for the remote server - the same way they are
used for the <TT>ProxyPass</TT> directive.
<P>
Example:<BR>
Suppose the local server has address <SAMP>http://wibble.org/</SAMP>; then
<PRE>
   ProxyPass         /mirror/foo http://foo.com
   ProxyPassReverse  /mirror/foo http://foo.com
</PRE>
will not only cause a local request for the
&lt;<SAMP>http://wibble.org/mirror/foo/bar</SAMP>&gt; to be internally
converted into a proxy request to &lt;<SAMP>http://foo.com/bar</SAMP>&gt; (the
functionality <SAMP>ProxyPass</SAMP> provides here). It also takes care of
redirects the server foo.com sends: when <SAMP>http://foo.com/bar</SAMP> is
redirected by him to <SAMP>http://foo.com/quux</SAMP> Apache adjusts this to
<SAMP>http://wibble.org/mirror/foo/quux</SAMP> before forwarding the HTTP
redirect response to the client. 
<P>
Note that this <SAMP>ProxyPassReverse</SAMP> directive can also by used in
conjunction with the proxy pass-through feature ("<SAMP>RewriteRule ...
[P]</SAMP>") from
<A
 HREF="mod_rewrite.html#RewriteRule"
><TT>mod_rewrite</TT></A> because its doesn't depend on a corresponding
<SAMP>ProxyPass</SAMP> directive.

<HR>

<H2><A NAME="proxyblock">ProxyBlock</A></H2>
<A
 HREF="directive-dict.html#Syntax"