]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_proxy.html.en
Adds a couple of seealso's.
[apache] / docs / manual / mod / mod_proxy.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>mod_proxy - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.3</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
19 <div id="path">
20 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_proxy</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy.html" title="English">&nbsp;en&nbsp;</a> |
25 <a href="../fr/mod/mod_proxy.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
26 <a href="../ja/mod/mod_proxy.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
27 </div>
28 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>HTTP/1.1 proxy/gateway server</td></tr>
29 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
30 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>proxy_module</td></tr>
31 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_proxy.c</td></tr></table>
32 <h3>Summary</h3>
33
34     <div class="warning"><h3>Warning</h3>
35       <p>Do not enable proxying with <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> until you have <a href="#access">secured your server</a>. Open proxy servers are dangerous both to your
36       network and to the Internet at large.</p>
37     </div>
38
39     <p>This module implements a proxy/gateway for Apache. It implements
40     proxying capability for <code>AJP13</code> (Apache JServe Protocol
41     version 1.3), <code>FTP</code>, <code>CONNECT</code> (for SSL),
42     <code>HTTP/0.9</code>, <code>HTTP/1.0</code>, and <code>HTTP/1.1</code>.
43     The module can be configured to connect to other proxy modules for these
44     and other protocols.</p>
45
46     <p>Apache's proxy features are divided into several modules in
47     addition to <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>:
48     <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code>, <code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code>,
49     <code class="module"><a href="../mod/mod_proxy_ajp.html">mod_proxy_ajp</a></code>, <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code>,
50     and <code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code>.  Thus, if you want to use
51     one or more of the particular proxy functions, load
52     <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> <em>and</em> the appropriate module(s)
53     into the server (either statically at compile-time or dynamically
54     via the <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>
55     directive).</p>
56
57     <p>In addition, extended features are provided by other modules.
58     Caching is provided by <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> and related
59     modules.  The ability to contact remote servers using the SSL/TLS
60     protocol is provided by the <code>SSLProxy*</code> directives of
61     <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>.  These additional modules will need
62     to be loaded and configured to take advantage of these features.</p>
63 </div>
64 <div id="quickview"><h3 class="directives">Directives</h3>
65 <ul id="toc">
66 <li><img alt="" src="../images/down.gif" /> <a href="#allowconnect">AllowCONNECT</a></li>
67 <li><img alt="" src="../images/down.gif" /> <a href="#balancermember">BalancerMember</a></li>
68 <li><img alt="" src="../images/down.gif" /> <a href="#noproxy">NoProxy</a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#proxy">&lt;Proxy&gt;</a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#proxybadheader">ProxyBadHeader</a></li>
71 <li><img alt="" src="../images/down.gif" /> <a href="#proxyblock">ProxyBlock</a></li>
72 <li><img alt="" src="../images/down.gif" /> <a href="#proxydomain">ProxyDomain</a></li>
73 <li><img alt="" src="../images/down.gif" /> <a href="#proxyerroroverride">ProxyErrorOverride</a></li>
74 <li><img alt="" src="../images/down.gif" /> <a href="#proxyftpdircharset">ProxyFtpDirCharset</a></li>
75 <li><img alt="" src="../images/down.gif" /> <a href="#proxyiobuffersize">ProxyIOBufferSize</a></li>
76 <li><img alt="" src="../images/down.gif" /> <a href="#proxymatch">&lt;ProxyMatch&gt;</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#proxymaxforwards">ProxyMaxForwards</a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#proxypass">ProxyPass</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassinterpolateenv">ProxyPassInterpolateEnv</a></li>
80 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassmatch">ProxyPassMatch</a></li>
81 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassreverse">ProxyPassReverse</a></li>
82 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassreversecookiedomain">ProxyPassReverseCookieDomain</a></li>
83 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassreversecookiepath">ProxyPassReverseCookiePath</a></li>
84 <li><img alt="" src="../images/down.gif" /> <a href="#proxypreservehost">ProxyPreserveHost</a></li>
85 <li><img alt="" src="../images/down.gif" /> <a href="#proxyreceivebuffersize">ProxyReceiveBufferSize</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#proxyremote">ProxyRemote</a></li>
87 <li><img alt="" src="../images/down.gif" /> <a href="#proxyremotematch">ProxyRemoteMatch</a></li>
88 <li><img alt="" src="../images/down.gif" /> <a href="#proxyrequests">ProxyRequests</a></li>
89 <li><img alt="" src="../images/down.gif" /> <a href="#proxyset">ProxySet</a></li>
90 <li><img alt="" src="../images/down.gif" /> <a href="#proxystatus">ProxyStatus</a></li>
91 <li><img alt="" src="../images/down.gif" /> <a href="#proxytimeout">ProxyTimeout</a></li>
92 <li><img alt="" src="../images/down.gif" /> <a href="#proxyvia">ProxyVia</a></li>
93 </ul>
94 <h3>Topics</h3>
95 <ul id="topics">
96 <li><img alt="" src="../images/down.gif" /> <a href="#forwardreverse">Forward Proxies and Reverse 
97        Proxies/Gateways</a></li>
98 <li><img alt="" src="../images/down.gif" /> <a href="#examples">Basic Examples</a></li>
99 <li><img alt="" src="../images/down.gif" /> <a href="#access">Controlling access to your proxy</a></li>
100 <li><img alt="" src="../images/down.gif" /> <a href="#startup">Slow Startup</a></li>
101 <li><img alt="" src="../images/down.gif" /> <a href="#intranet">Intranet Proxy</a></li>
102 <li><img alt="" src="../images/down.gif" /> <a href="#envsettings">Protocol Adjustments</a></li>
103 <li><img alt="" src="../images/down.gif" /> <a href="#request-bodies">Request Bodies</a></li>
104 <li><img alt="" src="../images/down.gif" /> <a href="#x-headers">Reverse Proxy Request Headers</a></li>
105 </ul><h3>See also</h3>
106 <ul class="seealso">
107 <li><code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code></li>
108 <li><code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code></li>
109 <li><code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code></li>
110 <li><code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code></li>
111 <li><code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code></li>
112 <li><code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code></li>
113 </ul></div>
114 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
115 <div class="section">
116 <h2><a name="forwardreverse" id="forwardreverse">Forward Proxies and Reverse 
117        Proxies/Gateways</a></h2>
118       <p>Apache can be configured in both a <dfn>forward</dfn> and
119       <dfn>reverse</dfn> proxy (also known as <dfn>gateway</dfn>) mode.</p>
120
121       <p>An ordinary <dfn>forward proxy</dfn> is an intermediate
122       server that sits between the client and the <em>origin
123       server</em>.  In order to get content from the origin server,
124       the client sends a request to the proxy naming the origin server
125       as the target and the proxy then requests the content from the
126       origin server and returns it to the client.  The client must be
127       specially configured to use the forward proxy to access other
128       sites.</p>
129
130       <p>A typical usage of a forward proxy is to provide Internet
131       access to internal clients that are otherwise restricted by a
132       firewall.  The forward proxy can also use caching (as provided
133       by <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>) to reduce network usage.</p>
134
135       <p>The forward proxy is activated using the <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive.  Because
136       forward proxies allow clients to access arbitrary sites through
137       your server and to hide their true origin, it is essential that
138       you <a href="#access">secure your server</a> so that only
139       authorized clients can access the proxy before activating a
140       forward proxy.</p>
141
142       <p>A <dfn>reverse proxy</dfn> (or <dfn>gateway</dfn>), by
143       contrast, appears to the client just like an ordinary web
144       server.  No special configuration on the client is necessary.
145       The client makes ordinary requests for content in the name-space
146       of the reverse proxy.  The reverse proxy then decides where to
147       send those requests, and returns the content as if it was itself
148       the origin.</p>
149
150       <p>A typical usage of a reverse proxy is to provide Internet
151       users access to a server that is behind a firewall.  Reverse
152       proxies can also be used to balance load among several back-end
153       servers, or to provide caching for a slower back-end server.
154       In addition, reverse proxies can be used simply to bring
155       several servers into the same URL space.</p>
156
157       <p>A reverse proxy is activated using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive or the
158       <code>[P]</code> flag to the <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directive.  It is
159       <strong>not</strong> necessary to turn <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> on in order to
160       configure a reverse proxy.</p>
161     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
162 <div class="section">
163 <h2><a name="examples" id="examples">Basic Examples</a></h2>
164
165     <p>The examples below are only a very basic idea to help you
166     get started.  Please read the documentation on the individual
167     directives.</p>
168
169     <p>In addition, if you wish to have caching enabled, consult
170     the documentation from <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>.</p>
171
172     <div class="example"><h3>Forward Proxy</h3><p><code>
173     ProxyRequests On<br />
174     ProxyVia On<br />
175     <br />
176     &lt;Proxy *&gt;<br />
177     <span class="indent">
178       Order deny,allow<br />
179       Deny from all<br />
180       Allow from internal.example.com<br />
181     </span>
182     &lt;/Proxy&gt;
183     </code></p></div>
184
185     <div class="example"><h3>Reverse Proxy</h3><p><code>
186     ProxyRequests Off<br />
187     <br />
188     &lt;Proxy *&gt;<br />
189     <span class="indent">
190       Order deny,allow<br />
191       Allow from all<br />
192     </span>
193     &lt;/Proxy&gt;<br />
194     <br />
195     ProxyPass /foo http://foo.example.com/bar<br />
196     ProxyPassReverse /foo http://foo.example.com/bar
197     </code></p></div>
198     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
199 <div class="section">
200 <h2><a name="access" id="access">Controlling access to your proxy</a></h2>
201       <p>You can control who can access your proxy via the <code class="directive"><a href="#proxy">&lt;Proxy&gt;</a></code> control block as in
202       the following example:</p>
203
204       <div class="example"><p><code>
205         &lt;Proxy *&gt;<br />
206         <span class="indent">
207           Order Deny,Allow<br />
208           Deny from all<br />
209           Allow from 192.168.0<br />
210         </span>
211         &lt;/Proxy&gt;
212       </code></p></div>
213
214       <p>For more information on access control directives, see
215       <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code>.</p>
216
217       <p>Strictly limiting access is essential if you are using a
218       forward proxy (using the <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive).
219       Otherwise, your server can be used by any client to access
220       arbitrary hosts while hiding his or her true identity.  This is
221       dangerous both for your network and for the Internet at large.
222       When using a reverse proxy (using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive with
223       <code>ProxyRequests Off</code>), access control is less
224       critical because clients can only contact the hosts that you
225       have specifically configured.</p>
226
227       <p><strong>See Also</strong> the <a href="mod_proxy_http.html#env">Proxy-Chain-Auth</a> environment variable.</p>
228
229     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
230 <div class="section">
231 <h2><a name="startup" id="startup">Slow Startup</a></h2>
232       <p>If you're using the <code class="directive"><a href="#proxyblock">ProxyBlock</a></code> directive, hostnames' IP addresses are looked up
233       and cached during startup for later match test. This may take a few
234       seconds (or more) depending on the speed with which the hostname lookups
235       occur.</p>
236     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
237 <div class="section">
238 <h2><a name="intranet" id="intranet">Intranet Proxy</a></h2>
239       <p>An Apache proxy server situated in an intranet needs to forward
240       external requests through the company's firewall (for this, configure
241       the <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> directive
242       to forward the respective <var>scheme</var> to the firewall proxy).
243       However, when it has to
244       access resources within the intranet, it can bypass the firewall when
245       accessing hosts. The <code class="directive"><a href="#noproxy">NoProxy</a></code>
246       directive is useful for specifying which hosts belong to the intranet and
247       should be accessed directly.</p>
248
249       <p>Users within an intranet tend to omit the local domain name from their
250       WWW requests, thus requesting "http://somehost/" instead of
251       <code>http://somehost.example.com/</code>. Some commercial proxy servers
252       let them get away with this and simply serve the request, implying a
253       configured local domain. When the <code class="directive"><a href="#proxydomain">ProxyDomain</a></code> directive is used and the server is <a href="#proxyrequests">configured for proxy service</a>, Apache can return
254       a redirect response and send the client to the correct, fully qualified,
255       server address. This is the preferred method since the user's bookmark
256       files will then contain fully qualified hosts.</p>
257     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
258 <div class="section">
259 <h2><a name="envsettings" id="envsettings">Protocol Adjustments</a></h2>
260       <p>For circumstances where <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> is sending
261       requests to an origin server that doesn't properly implement
262       keepalives or HTTP/1.1, there are two <a href="../env.html">environment variables</a> that can force the
263       request to use HTTP/1.0 with no keepalive. These are set via the
264       <code class="directive"><a href="../mod/mod_env.html#setenv">SetEnv</a></code> directive.</p>
265
266       <p>These are the <code>force-proxy-request-1.0</code> and
267       <code>proxy-nokeepalive</code> notes.</p>
268
269       <div class="example"><p><code>
270         &lt;Location /buggyappserver/&gt;<br />
271         <span class="indent">
272           ProxyPass http://buggyappserver:7001/foo/<br />
273           SetEnv force-proxy-request-1.0 1<br />
274           SetEnv proxy-nokeepalive 1<br />
275         </span>
276         &lt;/Location&gt;
277       </code></p></div>
278
279     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
280 <div class="section">
281 <h2><a name="request-bodies" id="request-bodies">Request Bodies</a></h2>
282
283     <p>Some request methods such as POST include a request body.
284     The HTTP protocol requires that requests which include a body
285     either use chunked transfer encoding or send a
286     <code>Content-Length</code> request header.  When passing these
287     requests on to the origin server, <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code>
288     will always attempt to send the <code>Content-Length</code>.  But
289     if the body is large and the original request used chunked
290     encoding, then chunked encoding may also be used in the upstream
291     request.  You can control this selection using <a href="../env.html">environment variables</a>.  Setting
292     <code>proxy-sendcl</code> ensures maximum compatibility with
293     upstream servers by always sending the
294     <code>Content-Length</code>, while setting
295     <code>proxy-sendchunked</code> minimizes resource usage by using
296     chunked encoding.</p>
297
298     </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
299 <div class="section">
300 <h2><a name="x-headers" id="x-headers">Reverse Proxy Request Headers</a></h2>
301
302     <p>When acting in a reverse-proxy mode (using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive, for example),
303     <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code> adds several request headers in
304     order to pass information to the origin server. These headers
305     are:</p>
306
307     <dl>
308       <dt><code>X-Forwarded-For</code></dt>
309       <dd>The IP address of the client.</dd>
310       <dt><code>X-Forwarded-Host</code></dt>
311       <dd>The original host requested by the client in the <code>Host</code> 
312        HTTP request header.</dd>
313       <dt><code>X-Forwarded-Server</code></dt>
314       <dd>The hostname of the proxy server.</dd>
315     </dl>
316
317     <p>Be careful when using these headers on the origin server, since
318     they will contain more than one (comma-separated) value if the
319     original request already contained one of these headers. For
320     example, you can use <code>%{X-Forwarded-For}i</code> in the log
321     format string of the origin server to log the original clients IP
322     address, but you may get more than one address if the request
323     passes through several proxies.</p>
324
325     <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
326     other request headers.</p>
327
328    </div>
329 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
330 <div class="directive-section"><h2><a name="AllowCONNECT" id="AllowCONNECT">AllowCONNECT</a> <a name="allowconnect" id="allowconnect">Directive</a></h2>
331 <table class="directive">
332 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Ports that are allowed to <code>CONNECT</code> through the
333 proxy</td></tr>
334 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowCONNECT <var>port</var> [<var>port</var>] ...</code></td></tr>
335 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowCONNECT 443 563</code></td></tr>
336 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
337 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
338 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
339 </table>
340     <p>The <code class="directive">AllowCONNECT</code> directive specifies a list
341     of port numbers to which the proxy <code>CONNECT</code> method may
342     connect.  Today's browsers use this method when a <code>https</code>
343     connection is requested and proxy tunneling over HTTP is in effect.</p>
344
345     <p>By default, only the default https port (<code>443</code>) and the
346     default snews port (<code>563</code>) are enabled. Use the
347     <code class="directive">AllowCONNECT</code> directive to override this default and
348     allow connections to the listed ports only.</p>
349
350     <p>Note that you'll need to have <code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code> present
351     in the server in order to get the support for the <code>CONNECT</code> at
352     all.</p>
353
354 </div>
355 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
356 <div class="directive-section"><h2><a name="BalancerMember" id="BalancerMember">BalancerMember</a> <a name="balancermember" id="balancermember">Directive</a></h2>
357 <table class="directive">
358 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Add a member to a load balancing group</td></tr>
359 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>BalancerMember [<var>balancerurl</var>] <var>url</var> [<var>key=value [key=value ...]]</var></code></td></tr>
360 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
361 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
362 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
363 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>BalancerMember is only available in Apache 2.2
364   and later.</td></tr>
365 </table>
366     <p>This directive adds a member to a load balancing group. It could be used
367     within a <code>&lt;Proxy <var>balancer://</var>...&gt;</code> container
368     directive, and can take any of the key value pair parameters available to
369     <code class="directive"><a href="#proxypass">ProxyPass</a></code> directives.</p>
370     <p>One additional parameter is available only to <code class="directive"><a href="#balancermember">BalancerMember</a></code> directives:
371     <var>loadfactor</var>. This is the member load factor - a number between 1 
372     (default) and 100, which defines the weighted load to be applied to the 
373     member in question.</p>
374     <p>The balancerurl is only needed when not in <code>&lt;Proxy <var>balancer://</var>...&gt;</code>
375     container directive. It corresponds to the url of a balancer defined in
376     <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
377
378 </div>
379 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
380 <div class="directive-section"><h2><a name="NoProxy" id="NoProxy">NoProxy</a> <a name="noproxy" id="noproxy">Directive</a></h2>
381 <table class="directive">
382 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hosts, domains, or networks that will be connected to
383 directly</td></tr>
384 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NoProxy <var>host</var> [<var>host</var>] ...</code></td></tr>
385 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
386 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
387 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
388 </table>
389     <p>This directive is only useful for Apache proxy servers within
390     intranets.  The <code class="directive">NoProxy</code> directive specifies a
391     list of subnets, IP addresses, hosts and/or domains, separated by
392     spaces. A request to a host which matches one or more of these is
393     always served directly, without forwarding to the configured
394     <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> proxy server(s).</p>
395
396     <div class="example"><h3>Example</h3><p><code>
397       ProxyRemote  *  http://firewall.example.com:81<br />
398       NoProxy         .example.com 192.168.112.0/21
399     </code></p></div>
400
401     <p>The <var>host</var> arguments to the <code class="directive">NoProxy</code>
402     directive are one of the following type list:</p>
403
404     <dl>
405     
406     <dt><var><a name="domain" id="domain">Domain</a></var></dt>
407     <dd>
408     <p>A <dfn>Domain</dfn> is a partially qualified DNS domain name, preceded
409     by a period. It represents a list of hosts which logically belong to the
410     same DNS domain or zone (<em>i.e.</em>, the suffixes of the hostnames are
411     all ending in <var>Domain</var>).</p>
412
413     <div class="example"><h3>Examples</h3><p><code>
414       .com .apache.org.
415     </code></p></div>
416
417     <p>To distinguish <var>Domain</var>s from <var><a href="#hostname">Hostname</a></var>s (both syntactically and semantically; a DNS domain can
418     have a DNS A record, too!), <var>Domain</var>s are always written with a
419     leading period.</p>
420     
421     <div class="note"><h3>Note</h3>
422       <p>Domain name comparisons are done without regard to the case, and
423       <var>Domain</var>s are always assumed to be anchored in the root of the
424       DNS tree, therefore two domains <code>.ExAmple.com</code> and
425       <code>.example.com.</code> (note the trailing period) are considered
426       equal. Since a domain comparison does not involve a DNS lookup, it is much
427       more efficient than subnet comparison.</p>
428     </div></dd>
429
430     
431     <dt><var><a name="subnet" id="subnet">SubNet</a></var></dt>
432     <dd>
433     <p>A <dfn>SubNet</dfn> is a partially qualified internet address in
434     numeric (dotted quad) form, optionally followed by a slash and the netmask,
435     specified as the number of significant bits in the <var>SubNet</var>. It is
436     used to represent a subnet of hosts which can be reached over a common
437     network interface. In the absence of the explicit net mask it is assumed
438     that omitted (or zero valued) trailing digits specify the mask. (In this
439     case, the netmask can only be multiples of 8 bits wide.) Examples:</p>
440
441     <dl>
442     <dt><code>192.168</code> or <code>192.168.0.0</code></dt>
443     <dd>the subnet 192.168.0.0 with an implied netmask of 16 valid bits
444     (sometimes used in the netmask form <code>255.255.0.0</code>)</dd>
445     <dt><code>192.168.112.0/21</code></dt>
446     <dd>the subnet <code>192.168.112.0/21</code> with a netmask of 21
447     valid bits (also used in the form <code>255.255.248.0</code>)</dd>
448     </dl>
449
450     <p>As a degenerate case, a <em>SubNet</em> with 32 valid bits is the
451     equivalent to an <var><a href="#ipadr">IPAddr</a></var>, while a <var>SubNet</var> with zero
452     valid bits (<em>e.g.</em>, 0.0.0.0/0) is the same as the constant
453     <var>_Default_</var>, matching any IP address.</p></dd>
454
455     
456     <dt><var><a name="ipaddr" id="ipaddr">IPAddr</a></var></dt>
457     <dd>
458     <p>A <dfn>IPAddr</dfn> represents a fully qualified internet address in
459     numeric (dotted quad) form. Usually, this address represents a host, but
460     there need not necessarily be a DNS domain name connected with the
461     address.</p>
462     <div class="example"><h3>Example</h3><p><code>
463       192.168.123.7
464     </code></p></div>
465     
466     <div class="note"><h3>Note</h3>
467       <p>An <var>IPAddr</var> does not need to be resolved by the DNS system, so
468       it can result in more effective apache performance.</p>
469     </div></dd>
470
471     
472     <dt><var><a name="hostname" id="hostname">Hostname</a></var></dt>
473     <dd>
474     <p>A <dfn>Hostname</dfn> is a fully qualified DNS domain name which can
475     be resolved to one or more <var><a href="#ipaddr">IPAddrs</a></var> via the
476     DNS domain name service. It represents a logical host (in contrast to
477     <var><a href="#domain">Domain</a></var>s, see above) and must be resolvable
478     to at least one <var><a href="#ipaddr">IPAddr</a></var> (or often to a list
479     of hosts with different <var><a href="#ipaddr">IPAddr</a></var>s).</p>
480
481     <div class="example"><h3>Examples</h3><p><code>
482       prep.ai.example.com<br />
483       www.apache.org
484     </code></p></div>
485
486     <div class="note"><h3>Note</h3>
487       <p>In many situations, it is more effective to specify an <var><a href="#ipaddr">IPAddr</a></var> in place of a <var>Hostname</var> since a
488       DNS lookup can be avoided. Name resolution in Apache can take a remarkable
489       deal of time when the connection to the name server uses a slow PPP
490       link.</p>
491       <p><var>Hostname</var> comparisons are done without regard to the case,
492       and <var>Hostname</var>s are always assumed to be anchored in the root
493       of the DNS tree, therefore two hosts <code>WWW.ExAmple.com</code>
494       and <code>www.example.com.</code> (note the trailing period) are
495       considered equal.</p>
496      </div></dd>
497     </dl>
498
499 <h3>See also</h3>
500 <ul>
501 <li><a href="../dns-caveats.html">DNS Issues</a></li>
502 </ul>
503 </div>
504 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
505 <div class="directive-section"><h2><a name="Proxy" id="Proxy">&lt;Proxy&gt;</a> <a name="proxy" id="proxy">Directive</a></h2>
506 <table class="directive">
507 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Container for directives applied to proxied resources</td></tr>
508 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;Proxy <var>wildcard-url</var>&gt; ...&lt;/Proxy&gt;</code></td></tr>
509 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
510 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
511 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
512 </table>
513     <p>Directives placed in <code class="directive">&lt;Proxy&gt;</code>
514     sections apply only to matching proxied content.  Shell-style wildcards are
515     allowed.</p>
516
517     <p>For example, the following will allow only hosts in
518     <code>yournetwork.example.com</code> to access content via your proxy
519     server:</p>
520
521     <div class="example"><p><code>
522       &lt;Proxy *&gt;<br />
523       <span class="indent">
524         Order Deny,Allow<br />
525         Deny from all<br />
526         Allow from yournetwork.example.com<br />
527       </span>
528       &lt;/Proxy&gt;
529     </code></p></div>
530
531     <p>The following example will process all files in the <code>foo</code>
532     directory of <code>example.com</code> through the <code>INCLUDES</code>
533     filter when they are sent through the proxy server:</p>
534
535     <div class="example"><p><code>
536       &lt;Proxy http://example.com/foo/*&gt;<br />
537       <span class="indent">
538         SetOutputFilter INCLUDES<br />
539       </span>
540       &lt;/Proxy&gt;
541     </code></p></div>
542
543
544 <h3>See also</h3>
545 <ul>
546 <li><code class="directive"><a href="#proxymatch">&lt;ProxyMatch&gt;</a></code></li>
547 </ul>
548 </div>
549 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
550 <div class="directive-section"><h2><a name="ProxyBadHeader" id="ProxyBadHeader">ProxyBadHeader</a> <a name="proxybadheader" id="proxybadheader">Directive</a></h2>
551 <table class="directive">
552 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines how to handle bad header lines in a
553 response</td></tr>
554 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyBadHeader IsError|Ignore|StartBody</code></td></tr>
555 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyBadHeader IsError</code></td></tr>
556 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
557 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
558 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
559 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.44 and later</td></tr>
560 </table>
561     <p>The <code class="directive">ProxyBadHeader</code> directive determines the
562     behaviour of <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> if it receives syntactically invalid
563     header lines (<em>i.e.</em> containing no colon). The following arguments
564     are possible:</p>
565
566     <dl>
567     <dt><code>IsError</code></dt>
568     <dd>Abort the request and end up with a 502 (Bad Gateway) response. This is
569     the default behaviour.</dd>
570
571     <dt><code>Ignore</code></dt>
572     <dd>Treat bad header lines as if they weren't sent.</dd>
573
574     <dt><code>StartBody</code></dt>
575     <dd>When receiving the first bad header line, finish reading the headers and
576     treat the remainder as body. This helps to work around buggy backend servers
577     which forget to insert an empty line between the headers and the body.</dd>
578     </dl>
579
580 </div>
581 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
582 <div class="directive-section"><h2><a name="ProxyBlock" id="ProxyBlock">ProxyBlock</a> <a name="proxyblock" id="proxyblock">Directive</a></h2>
583 <table class="directive">
584 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Words, hosts, or domains that are banned from being
585 proxied</td></tr>
586 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyBlock *|<var>word</var>|<var>host</var>|<var>domain</var>
587 [<var>word</var>|<var>host</var>|<var>domain</var>] ...</code></td></tr>
588 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
589 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
590 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
591 </table>
592     <p>The <code class="directive">ProxyBlock</code> directive specifies a list of
593     words, hosts and/or domains, separated by spaces.  HTTP, HTTPS, and
594     FTP document requests to sites whose names contain matched words,
595     hosts or domains are <em>blocked</em> by the proxy server. The proxy
596     module will also attempt to determine IP addresses of list items which
597     may be hostnames during startup, and cache them for match test as
598     well. That may slow down the startup time of the server.</p>
599
600     <div class="example"><h3>Example</h3><p><code>
601       ProxyBlock joes-garage.com some-host.co.uk rocky.wotsamattau.edu
602     </code></p></div>
603
604     <p><code>rocky.wotsamattau.edu</code> would also be matched if referenced by
605     IP address.</p>
606
607     <p>Note that <code>wotsamattau</code> would also be sufficient to match
608     <code>wotsamattau.edu</code>.</p>
609
610     <p>Note also that</p>
611
612     <div class="example"><p><code>
613       ProxyBlock *
614     </code></p></div>
615
616     <p>blocks connections to all sites.</p>
617
618 </div>
619 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
620 <div class="directive-section"><h2><a name="ProxyDomain" id="ProxyDomain">ProxyDomain</a> <a name="proxydomain" id="proxydomain">Directive</a></h2>
621 <table class="directive">
622 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default domain name for proxied requests</td></tr>
623 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyDomain <var>Domain</var></code></td></tr>
624 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
625 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
626 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
627 </table>
628     <p>This directive is only useful for Apache proxy servers within
629     intranets. The <code class="directive">ProxyDomain</code> directive specifies
630     the default domain which the apache proxy server will belong to. If a
631     request to a host without a domain name is encountered, a redirection
632     response to the same host with the configured <var>Domain</var> appended
633     will be generated.</p>
634
635     <div class="example"><h3>Example</h3><p><code>
636       ProxyRemote  *  http://firewall.example.com:81<br />
637       NoProxy         .example.com 192.168.112.0/21<br />
638       ProxyDomain     .example.com
639     </code></p></div>
640
641 </div>
642 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
643 <div class="directive-section"><h2><a name="ProxyErrorOverride" id="ProxyErrorOverride">ProxyErrorOverride</a> <a name="proxyerroroverride" id="proxyerroroverride">Directive</a></h2>
644 <table class="directive">
645 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Override error pages for proxied content</td></tr>
646 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyErrorOverride On|Off</code></td></tr>
647 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyErrorOverride Off</code></td></tr>
648 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
649 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
650 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
651 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0 and later</td></tr>
652 </table>
653     <p>This directive is useful for reverse-proxy setups, where you want to 
654     have a common look and feel on the error pages seen by the end user. 
655     This also allows for included files (via
656     <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>'s SSI) to get
657     the error code and act accordingly (default behavior would display
658     the error page of the proxied server, turning this on shows the SSI
659     Error message).</p>
660
661     <p>This directive does not affect the processing of informational (1xx),
662     normal success (2xx), or redirect (3xx) responses.</p>
663
664 </div>
665 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
666 <div class="directive-section"><h2><a name="ProxyFtpDirCharset" id="ProxyFtpDirCharset">ProxyFtpDirCharset</a> <a name="proxyftpdircharset" id="proxyftpdircharset">Directive</a></h2>
667 <table class="directive">
668 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Define the character set for proxied FTP listings</td></tr>
669 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyFtpDirCharset <var>character set</var></code></td></tr>
670 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyFtpDirCharset ISO-8859-1</code></td></tr>
671 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
672 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
673 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
674 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.2.7 and later</td></tr>
675 </table>
676     <p>The <code class="directive">ProxyFtpDirCharset</code> directive defines the
677     character set to be set for FTP directory listings in HTML generated by
678     <code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code>.</p>
679
680 </div>
681 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
682 <div class="directive-section"><h2><a name="ProxyIOBufferSize" id="ProxyIOBufferSize">ProxyIOBufferSize</a> <a name="proxyiobuffersize" id="proxyiobuffersize">Directive</a></h2>
683 <table class="directive">
684 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine size of internal data throughput buffer</td></tr>
685 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyIOBufferSize <var>bytes</var></code></td></tr>
686 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyIOBufferSize 8192</code></td></tr>
687 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
688 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
689 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
690 </table>
691     <p>The <code class="directive">ProxyIOBufferSize</code> directive adjusts the size
692     of the internal buffer, which is used as a scratchpad for the data between
693     input and output. The size must be at least <code>512</code>.</p>
694
695     <p>In almost every case there's no reason to change that value.</p>
696     <p>If used with AJP this directive sets the maximum AJP packet size in
697     bytes. If you change it from the default, you must also change the 
698     <code>packetSize</code> attribute of your AJP connector on the
699     Tomcat side! The attribute <code>packetSize</code> is only available
700     in Tomcat <code>5.5.20+</code> and <code>6.0.2+</code></p>
701     <p>Normally it is not necessary to change the maximum packet size.
702     Problems with the default value have been reported when sending
703     certificates or certificate chains.</p>
704     
705
706 </div>
707 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
708 <div class="directive-section"><h2><a name="ProxyMatch" id="ProxyMatch">&lt;ProxyMatch&gt;</a> <a name="proxymatch" id="proxymatch">Directive</a></h2>
709 <table class="directive">
710 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Container for directives applied to regular-expression-matched 
711 proxied resources</td></tr>
712 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;ProxyMatch <var>regex</var>&gt; ...&lt;/ProxyMatch&gt;</code></td></tr>
713 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
714 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
715 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
716 </table>
717     <p>The <code class="directive">&lt;ProxyMatch&gt;</code> directive is
718     identical to the <code class="directive"><a href="#proxy">&lt;Proxy&gt;</a></code> directive, except it matches URLs
719     using <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expressions</a>.</p>
720
721 <h3>See also</h3>
722 <ul>
723 <li><code class="directive"><a href="#proxy">&lt;Proxy&gt;</a></code></li>
724 </ul>
725 </div>
726 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
727 <div class="directive-section"><h2><a name="ProxyMaxForwards" id="ProxyMaxForwards">ProxyMaxForwards</a> <a name="proxymaxforwards" id="proxymaxforwards">Directive</a></h2>
728 <table class="directive">
729 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximium number of proxies that a request can be forwarded
730 through</td></tr>
731 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyMaxForwards <var>number</var></code></td></tr>
732 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyMaxForwards -1</code></td></tr>
733 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
734 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
735 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
736 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0 and later;
737         default behaviour changed in 2.2.7/2.3</td></tr>
738 </table>
739     <p>The <code class="directive">ProxyMaxForwards</code> directive specifies the
740     maximum number of proxies through which a request may pass, if there's no
741     <code>Max-Forwards</code> header supplied with the request. This may
742     be set to prevent infinite proxy loops, or a DoS attack.</p>
743
744     <div class="example"><h3>Example</h3><p><code>
745       ProxyMaxForwards 15
746     </code></p></div>
747
748     <p>Note that setting <code class="directive">ProxyMaxForwards</code> is a
749     violation of the HTTP/1.1 protocol (RFC2616), which forbids a Proxy
750     setting <code>Max-Forwards</code> if the Client didn't set it.
751     Earlier Apache versions would always set it.  A negative
752     <code class="directive">ProxyMaxForwards</code> value, including the
753     default -1, gives you protocol-compliant behaviour, but may
754     leave you open to loops.</p>
755
756 </div>
757 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
758 <div class="directive-section"><h2><a name="ProxyPass" id="ProxyPass">ProxyPass</a> <a name="proxypass" id="proxypass">Directive</a></h2>
759 <table class="directive">
760 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps remote servers into the local server URL-space</td></tr>
761 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPass [<var>path</var>] !|<var>url</var> [<var>key=value</var>
762   <var>[key=value</var> ...]] [nocanon] [interpolate]</code></td></tr>
763 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
764 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
765 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
766 </table>
767     <p>This directive allows remote servers to be mapped into the
768     space of the local server; the local server does not act as a
769     proxy in the conventional sense, but appears to be a mirror of the
770     remote server. The local server is often called a <dfn>reverse
771     proxy</dfn> or <dfn>gateway</dfn>. The <var>path</var> is the name of
772     a local virtual path; <var>url</var> is a partial URL for the
773     remote server and cannot include a query string.</p>
774
775     <div class="warning">The <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive should
776     usually be set <strong>off</strong> when using
777     <code class="directive">ProxyPass</code>.</div>
778
779     <p>Suppose the local server has address <code>http://example.com/</code>;
780     then</p>
781
782     <div class="example"><p><code>
783       ProxyPass /mirror/foo/ http://backend.example.com/
784     </code></p></div>
785
786     <p>will cause a local request for
787     <code>http://example.com/mirror/foo/bar</code> to be internally converted
788     into a proxy request to <code>http://backend.example.com/bar</code>.</p>
789
790     <div class="warning">
791     <p>If the first argument ends with a trailing <strong>/</strong>, the second
792        argument should also end with a trailing <strong>/</strong> and vice
793        versa. Otherwise the resulting requests to the backend may miss some
794        needed slashes and do not deliver the expected results.
795     </p>
796     </div>
797
798     <p>The <code>!</code> directive is useful in situations where you don't want
799     to reverse-proxy a subdirectory, <em>e.g.</em></p>
800
801     <div class="example"><p><code>
802       ProxyPass /mirror/foo/i !<br />
803       ProxyPass /mirror/foo http://backend.example.com
804     </code></p></div>
805
806     <p>will proxy all requests to <code>/mirror/foo</code> to
807     <code>backend.example.com</code> <em>except</em> requests made to
808     <code>/mirror/foo/i</code>.</p>
809
810     <div class="note"><h3>Note</h3>
811       <p>Order is important: exclusions must come <em>before</em> the
812       general <code class="directive">ProxyPass</code> directive.</p>
813     </div>
814
815     <p>As of Apache 2.1, the ability to use pooled connections to a backend
816     server is available. Using the <code>key=value</code> parameters it is
817     possible to tune this connection pooling. The default for a <code>Hard
818     Maximum</code> for the number of connections is the number of threads per
819     process in the active MPM. In the Prefork MPM, this is always 1, while with
820     the Worker MPM it is controlled by the
821     <code class="directive">ThreadsPerChild</code>.</p>
822
823     <p>Setting <code>min</code> will determine how many connections will always 
824     be open to the backend server. Upto the Soft Maximum or <code>smax</code> 
825     number of connections will be created on demand. Any connections above 
826     <code>smax</code> are subject to a time to live or <code>ttl</code>.  Apache
827     will never create more than the Hard Maximum or <code>max</code> connections
828     to the backend server.</p>
829
830     <div class="example"><p><code>
831         ProxyPass /example http://backend.example.com smax=5 max=20 ttl=120 retry=300
832     </code></p></div>
833
834     <table>
835     <tr><th>Parameter</th>
836         <th>Default</th>
837         <th>Description</th></tr>
838     <tr><td>min</td>
839         <td>0</td>
840         <td>Minimum number of connections that will always
841             be open to the backend server.</td></tr>
842     <tr><td>max</td>
843         <td>1...n</td>
844         <td>Hard Maximum number of connections that will be
845     allowed to the backend server. The default for a Hard Maximum
846     for the number of connections is the number of threads per process in the 
847     active MPM. In the Prefork MPM, this is always 1, while with the Worker MPM
848     it is controlled by the <code class="directive">ThreadsPerChild</code>.
849     Apache will never create more than the Hard Maximum connections
850     to the backend server.</td></tr>
851     <tr><td>smax</td>
852         <td>max</td>
853         <td>Upto the Soft Maximum
854     number of connections will be created on demand. Any connections above 
855     <code>smax</code> are subject to a time to live or <code>ttl</code>.
856     </td></tr>
857     <tr><td>acquire</td>
858         <td>-</td>
859         <td>If set this will be the maximum time to wait for a free
860     connection in the connection pool, in milliseconds. If there are no free
861     connections in the pool the Apache will return <code>SERVER_BUSY</code>
862     status to the client.
863     </td></tr>
864     <tr><td>connectiontimeout</td>
865         <td>timeout</td>
866         <td>Connect timeout in seconds.
867         The number of seconds Apache waits for the creation of a connection to
868         the backend to complete. By adding a postfix of ms the timeout can be
869         also set in milliseconds.
870     </td></tr>
871     <tr><td>disablereuse</td>
872         <td>Off</td>
873         <td>This parameter should be used when you want to force mod_proxy
874     to immediately close a connection to the backend after being used, and
875     thus, disable its persistent connection and pool for that backend.
876     This helps in various situations where a firewall between Apache and
877     the backend server (regardless of protocol) tends to silently
878     drop connections or when backends themselves may be under round-
879     robin DNS. To disable connection pooling reuse,
880     set this property value to <code>On</code>. 
881     </td></tr>
882     <tr><td>flushpackets</td>
883         <td>off</td>
884         <td>Determines whether the proxy module will auto-flush the output
885         brigade after each "chunk" of data. 'off' means that it will flush
886         only when needed, 'on' means after each chunk is sent and
887         'auto' means poll/wait for a period of time and flush if
888         no input has been received for 'flushwait' milliseconds.
889         Currently this is in effect only for AJP.
890     </td></tr>
891     <tr><td>flushwait</td>
892         <td>10</td>
893         <td>The time to wait for additional input, in milliseconds, before
894         flushing the output brigade if 'flushpackets' is 'auto'.
895     </td></tr>
896     <tr><td>iobuffersize</td>
897         <td>8192</td>
898         <td>Adjusts the size of the internal scratchpad IO buffer. This allows you
899         to override the <code class="directive">ProxyIOBufferSize</code> for a specific worker.
900         This must be at least 512 or set to 0 for the system default of 8192.
901     </td></tr>
902     <tr><td>keepalive</td>
903         <td>Off</td>
904         <td>This parameter should be used when you have a firewall between your
905     Apache and the backend server, who tend to drop inactive connections.
906     This flag will tell the Operating System to send <code>KEEP_ALIVE</code>
907     messages on inactive connections (interval depends on global OS settings,
908     generally 120ms), and thus prevent the firewall to drop the connection.
909     To enable keepalive set this property value to <code>On</code>. 
910     </td></tr>
911     <tr><td>lbset</td>
912         <td>0</td>
913         <td>Sets the load balancer cluster set that the worker is a member
914          of. The load balancer will try all members of a lower numbered
915          lbset before trying higher numbered ones.
916     </td></tr>
917     <tr><td>ping</td>
918         <td>0</td>
919         <td>Ping property tells webserver to send a <code>CPING</code>
920         request on ajp13 connection before forwarding a request.
921         The parameter is the delay in seconds to wait for the
922         <code>CPONG</code> reply.
923         This features has been added to avoid problem with hung and
924         busy Tomcat's and require ajp13 ping/pong support which has
925         been implemented on Tomcat 3.3.2+, 4.1.28+ and 5.0.13+.
926         This will increase the network traffic during the normal operation
927         which could be an issue, but it will lower the
928         traffic in case some of the cluster nodes are down or busy.
929         Currently this has an effect only for AJP.
930         By adding a postfix of ms the delay can be also set in
931         milliseconds.
932     </td></tr>
933     <tr><td>receivebuffersize</td>
934         <td>0</td>
935         <td>Adjusts the size of the explicit (TCP/IP) network buffer size for
936         proxied connections. This allows you to override the
937         <code class="directive">ProxyReceiveBufferSize</code> for a specific worker.
938         This must be at least 512 or set to 0 for the system default.
939     </td></tr>
940     <tr><td>redirect</td>
941         <td>-</td>
942         <td>Redirection Route of the worker. This value is usually
943         set dynamically to enable safe removal of the node from
944         the cluster. If set all requests without session id will be
945         redirected to the BalancerMember that has route parametar
946         equal as this value.
947     </td></tr>
948     <tr><td>retry</td>
949         <td>60</td>
950         <td>Connection pool worker retry timeout in seconds.
951     If the connection pool worker to the backend server is in the error state,
952     Apache will not forward any requests to that server until the timeout
953     expires. This enables to shut down the backend server for maintenance,
954     and bring it back online later. A value of 0 means always retry workers
955     in an error state with no timeout.
956     </td></tr>
957     <tr><td>route</td>
958         <td>-</td>
959         <td>Route of the worker when used inside load balancer.
960         The route is a value appended to session id.
961     </td></tr>
962     <tr><td>status</td>
963         <td>-</td>
964         <td>Single letter value defining the initial status of
965         this worker: 'D' is disabled, 'S' is stopped, 'I' is ignore-errors,
966         'H' is hot-standby and 'E' is in an error state. Status 
967         can be set (which is the default) by prepending with '+' or 
968         cleared by prepending with '-'.
969         Thus, a setting of 'S-E' sets this worker to Stopped and
970         clears the in-error flag.
971     </td></tr>
972     <tr><td>timeout</td>
973         <td><code class="directive"><a href="#proxytimeout">ProxyTimeout</a></code></td>
974         <td>Connection timeout in seconds.
975         The number of seconds Apache waits for data sent by / to the backend.
976     </td></tr>
977     <tr><td>ttl</td>
978         <td>-</td>
979         <td>Time To Live for the inactive connections above the
980         <code>smax</code> connections in seconds. Apache will close all
981         connections that has not been used inside that time period.
982     </td></tr>
983
984     </table>
985
986     <p>If the Proxy directive scheme starts with the
987     <code>balancer://</code> (eg: <code>balancer://cluster/</code>, 
988     any path information is ignored)  then a virtual worker that does not really
989     communicate with the backend server will be created. Instead it is responsible
990     for the management of several "real" workers. In that case the special set of
991     parameters can be add to this virtual worker. See <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code>
992     for more information about how the balancer works.
993     </p>
994     <table>
995     <tr><th>Parameter</th>
996         <th>Default</th>
997         <th>Description</th></tr>
998     <tr><td>lbmethod</td>
999         <td>byrequests</td>
1000         <td>Balancer load-balance method. Select the load-balancing scheduler
1001         method to use. Either <code>byrequests</code>, to perform weighted
1002         request counting, <code>bytraffic</code>, to perform weighted
1003         traffic byte count balancing, or <code>bybusyness</code>, to perform 
1004         pending request balancing. Default is <code>byrequests</code>.
1005     </td></tr>
1006     <tr><td>maxattempts</td>
1007         <td>1</td>
1008         <td>Maximum number of failover attempts before giving up. 
1009     </td></tr>
1010     <tr><td>nofailover</td>
1011         <td>Off</td>
1012         <td>If set to <code>On</code> the session will break if the worker is in
1013         error state or disabled. Set this value to On if backend servers do not
1014         support session replication.
1015     </td></tr>
1016     <tr><td>stickysession</td>
1017         <td>-</td>
1018         <td>Balancer sticky session name. The value is usually set to something
1019         like <code>JSESSIONID</code> or <code>PHPSESSIONID</code>,
1020         and it depends on the backend application server that support sessions.
1021         If the backend application server uses different name for cookies
1022         and url encoded id (like servlet containers) use | to to separate them.
1023         The first part is for the cookie the second for the path.
1024     </td></tr>
1025     <tr><td>scolonpathdelim</td>
1026         <td>Off</td>
1027         <td>If set to <code>On</code> the semi-colon character ';' will be
1028         used as an additional sticky session path deliminator/separator. This
1029         is mainly used to emulate mod_jk's behavior when dealing with paths such
1030         as <code>JSESSIONID=6736bcf34;foo=aabfa</code>
1031     </td></tr>
1032     <tr><td>timeout</td>
1033         <td>0</td>
1034         <td>Balancer timeout in seconds. If set this will be the maximum time
1035         to wait for a free worker. Default is not to wait. 
1036     </td></tr>
1037     
1038     </table>
1039     <p>A sample balancer setup</p>
1040     <div class="example"><p><code>
1041       ProxyPass /special-area http://special.example.com/ smax=5 max=10<br />
1042       ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On<br />
1043       &lt;Proxy balancer://mycluster&gt;<br />
1044       <span class="indent">
1045         BalancerMember http://1.2.3.4:8009<br />
1046         BalancerMember http://1.2.3.5:8009 smax=10<br />
1047         # Less powerful server, don't send as many requests there<br />
1048         BalancerMember http://1.2.3.6:8009 smax=1 loadfactor=20<br />
1049       </span>
1050       &lt;/Proxy&gt;
1051     </code></p></div>
1052
1053     <p>Setting up a hot-standby, that will only be used if no other
1054      members are available</p>
1055     <div class="example"><p><code>
1056       ProxyPass / balancer://hotcluster/ <br />
1057       &lt;Proxy balancer://hotcluster&gt;<br />
1058       <span class="indent">
1059         BalancerMember http://1.2.3.4:8009 loadfactor=1<br />
1060         BalancerMember http://1.2.3.5:8009 loadfactor=2<br />
1061         # The below is the hot standby<br />
1062         BalancerMember http://1.2.3.6:8009 status=+H<br />
1063         ProxySet lbmethod=bytraffic
1064       </span>
1065       &lt;/Proxy&gt;
1066     </code></p></div>
1067
1068     <p>Normally, mod_proxy will canonicalise ProxyPassed URLs.
1069     But this may be incompatible with some backends, particularly those
1070     that make use of <var>PATH_INFO</var>.  The optional <var>nocanon</var>
1071     keyword suppresses this, and passes the URL path "raw" to the
1072     backend.  Note that may affect the security of your backend, as it
1073     removes the normal limited protection against URL-based attacks
1074     provided by the proxy.</p>
1075
1076     <p>The optional <var>interpolate</var> keyword (available in
1077     httpd 2.2.9 and later), in combination with
1078     <code class="directive">ProxyPassInterpolateEnv</code> causes the ProxyPass
1079     to interpolate environment variables, using the syntax
1080     <var>${VARNAME}</var>.  Note that many of the standard CGI-derived
1081     environment variables will not exist when this interpolation happens,
1082     so you may still have to resort to <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
1083     for complex rules.</p>
1084
1085     <p>When used inside a <code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code> section, the first argument is omitted and the local
1086     directory is obtained from the <code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code>.</p>
1087
1088     <p>If you require a more flexible reverse-proxy configuration, see the
1089     <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directive with the
1090     <code>[P]</code> flag.</p>
1091
1092 </div>
1093 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1094 <div class="directive-section"><h2><a name="ProxyPassInterpolateEnv" id="ProxyPassInterpolateEnv">ProxyPassInterpolateEnv</a> <a name="proxypassinterpolateenv" id="proxypassinterpolateenv">Directive</a></h2>
1095 <table class="directive">
1096 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable Environment Variable interpolation in Reverse Proxy configurations</td></tr>
1097 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassInterpolateEnv On|Off</code></td></tr>
1098 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyPassInterpolateEnv Off</code></td></tr>
1099 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1100 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1101 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1102 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in httpd 2.2.9 and later</td></tr>
1103 </table>
1104     <p>This directive, together with the <var>interpolate</var> argument to
1105     <code class="directive">ProxyPass</code>, <code class="directive">ProxyPassReverse</code>,
1106     <code class="directive">ProxyPassReverseCookieDomain</code> and
1107     <code class="directive">ProxyPassReverseCookiePath</code>
1108     enables reverse proxies to be dynamically
1109     configured using environment variables, which may be set by
1110     another module such as <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>.
1111     It affects the <code class="directive">ProxyPass</code>,
1112     <code class="directive">ProxyPassReverse</code>,
1113     <code class="directive">ProxyPassReverseCookieDomain</code>, and
1114     <code class="directive">ProxyPassReverseCookiePath</code> directives,
1115     and causes them to substitute the value of an environment
1116     variable <code>varname</code> for the string <code>${varname}</code>
1117     in configuration directives.</p>
1118     <p>Keep this turned off (for server performance) unless you need it!</p>
1119
1120 </div>
1121 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1122 <div class="directive-section"><h2><a name="ProxyPassMatch" id="ProxyPassMatch">ProxyPassMatch</a> <a name="proxypassmatch" id="proxypassmatch">Directive</a></h2>
1123 <table class="directive">
1124 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps remote servers into the local server URL-space using regular expressions</td></tr>
1125 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassMatch [<var>regex</var>] !|<var>url</var> [<var>key=value</var>
1126         <var>[key=value</var> ...]]</code></td></tr>
1127 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1128 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1129 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1130 </table>
1131     <p>This directive is equivalent to <code class="directive"><a href="#proxypass">ProxyPass</a></code>,
1132        but makes use of regular expressions, instead of simple prefix matching. The
1133        supplied regular expression is matched against the <var>url</var>, and if it
1134        matches, the server will substitute any parenthesized matches into the given
1135        string and use it as a new <var>url</var>.</p>
1136
1137     <p>Suppose the local server has address <code>http://example.com/</code>;
1138     then</p>
1139
1140     <div class="example"><p><code>
1141       ProxyPassMatch ^(/.*\.gif)$ http://backend.example.com$1
1142     </code></p></div>
1143
1144     <p>will cause a local request for
1145     <code>http://example.com/foo/bar.gif</code> to be internally converted
1146     into a proxy request to <code>http://backend.example.com/foo/bar.gif</code>.</p>
1147     <div class="note"><h3>Note</h3>
1148       <p>The URL argument must be parsable as a URL <em>before</em> regexp
1149       substitutions (as well as after).  This limits the matches you can use.
1150       For instance, if we had used</p>
1151       <div class="example"><p><code>
1152         ProxyPassMatch ^(/.*\.gif)$ http://backend.example.com:8000$1
1153       </code></p></div>
1154       <p>in our previous example, it would fail with a syntax error
1155       at server startup.  This is a bug (PR 46665 in the ASF bugzilla),
1156       and the workaround is to reformulate the match:</p>
1157       <div class="example"><p><code>
1158         ProxyPassMatch ^/(.*\.gif)$ http://backend.example.com:8000/$1
1159       </code></p></div>
1160     </div>
1161     <p>The <code>!</code> directive is useful in situations where you don't want
1162     to reverse-proxy a subdirectory.</p>
1163
1164 </div>
1165 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1166 <div class="directive-section"><h2><a name="ProxyPassReverse" id="ProxyPassReverse">ProxyPassReverse</a> <a name="proxypassreverse" id="proxypassreverse">Directive</a></h2>
1167 <table class="directive">
1168 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the URL in HTTP response headers sent from a reverse
1169 proxied server</td></tr>
1170 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverse [<var>path</var>] <var>url</var>
1171 [<var>interpolate</var>]</code></td></tr>
1172 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1173 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1174 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1175 </table>
1176     <p>This directive lets Apache adjust the URL in the <code>Location</code>,
1177     <code>Content-Location</code> and <code>URI</code> headers on HTTP
1178     redirect responses. This is essential when Apache is used as a
1179     reverse proxy (or gateway) to avoid by-passing the reverse proxy
1180     because of HTTP redirects on the backend servers which stay behind
1181     the reverse proxy.</p>
1182
1183     <p>Only the HTTP response headers specifically mentioned above
1184     will be rewritten.  Apache will not rewrite other response
1185     headers, nor will it rewrite URL references inside HTML pages.
1186     This means that if the proxied content contains absolute URL
1187     references, they will by-pass the proxy.  A third-party module
1188     that will look inside the HTML and rewrite URL references is Nick
1189     Kew's <a href="http://apache.webthing.com/mod_proxy_html/">mod_proxy_html</a>.</p>
1190
1191     <p><var>path</var> is the name of a local virtual path. <var>url</var> is a
1192     partial URL for the remote server - the same way they are used for the
1193     <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
1194
1195     <p>For example, suppose the local server has address
1196     <code>http://example.com/</code>; then</p>
1197
1198     <div class="example"><p><code>
1199       ProxyPass         /mirror/foo/ http://backend.example.com/<br />
1200       ProxyPassReverse  /mirror/foo/ http://backend.example.com/<br />
1201       ProxyPassReverseCookieDomain  backend.example.com  public.example.com<br />
1202       ProxyPassReverseCookiePath  /  /mirror/foo/
1203     </code></p></div>
1204
1205     <p>will not only cause a local request for the
1206     <code>http://example.com/mirror/foo/bar</code> to be internally converted
1207     into a proxy request to <code>http://backend.example.com/bar</code>
1208     (the functionality <code>ProxyPass</code> provides here). It also takes care
1209     of redirects the server <code>backend.example.com</code> sends: when
1210     <code>http://backend.example.com/bar</code> is redirected by him to
1211     <code>http://backend.example.com/quux</code> Apache adjusts this to
1212     <code>http://example.com/mirror/foo/quux</code> before forwarding the HTTP
1213     redirect response to the client. Note that the hostname used for
1214     constructing the URL is chosen in respect to the setting of the <code class="directive"><a href="../mod/core.html#usecanonicalname">UseCanonicalName</a></code> directive.</p>
1215
1216     <p>Note that this <code class="directive">ProxyPassReverse</code> directive can
1217     also be used in conjunction with the proxy pass-through feature
1218     (<code>RewriteRule ...  [P]</code>) from <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
1219     because it doesn't depend on a corresponding <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
1220
1221     <p>The optional <var>interpolate</var> keyword (available in
1222     httpd 2.2.9 and later), used together with
1223     <code class="directive">ProxyPassInterpolateEnv</code>, enables interpolation
1224     of environment variables specified using the format <var>${VARNAME}</var>.
1225     </p>
1226
1227     <p>When used inside a <code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code> section, the first argument is omitted and the local
1228     directory is obtained from the <code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code>.</p>
1229
1230 </div>
1231 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1232 <div class="directive-section"><h2><a name="ProxyPassReverseCookieDomain" id="ProxyPassReverseCookieDomain">ProxyPassReverseCookieDomain</a> <a name="proxypassreversecookiedomain" id="proxypassreversecookiedomain">Directive</a></h2>
1233 <table class="directive">
1234 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the Domain string in Set-Cookie headers from a reverse-
1235 proxied server</td></tr>
1236 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverseCookieDomain <var>internal-domain</var>
1237 <var>public-domain</var> [<var>interpolate</var>]</code></td></tr>
1238 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1239 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1240 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1241 </table>
1242 <p>Usage is basically similar to
1243 <code class="directive"><a href="#proxypassreverse">ProxyPassReverse</a></code>, but instead of
1244 rewriting headers that are a URL, this rewrites the <code>domain</code>
1245 string in <code>Set-Cookie</code> headers.</p>
1246
1247 </div>
1248 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1249 <div class="directive-section"><h2><a name="ProxyPassReverseCookiePath" id="ProxyPassReverseCookiePath">ProxyPassReverseCookiePath</a> <a name="proxypassreversecookiepath" id="proxypassreversecookiepath">Directive</a></h2>
1250 <table class="directive">
1251 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the Path string in Set-Cookie headers from a reverse-
1252 proxied server</td></tr>
1253 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverseCookiePath <var>internal-path</var>
1254 <var>public-path</var> [<var>interpolate</var>]</code></td></tr>
1255 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1256 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1257 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1258 </table>
1259 <p>Usage is basically similar to
1260 <code class="directive"><a href="#proxypassreverse">ProxyPassReverse</a></code>, but instead of
1261 rewriting headers that are a URL, this rewrites the <code>path</code>
1262 string in <code>Set-Cookie</code> headers.</p>
1263
1264 </div>
1265 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1266 <div class="directive-section"><h2><a name="ProxyPreserveHost" id="ProxyPreserveHost">ProxyPreserveHost</a> <a name="proxypreservehost" id="proxypreservehost">Directive</a></h2>
1267 <table class="directive">
1268 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use incoming Host HTTP request header for proxy
1269 request</td></tr>
1270 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPreserveHost On|Off</code></td></tr>
1271 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyPreserveHost Off</code></td></tr>
1272 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1273 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1274 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1275 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.31 and later.</td></tr>
1276 </table>
1277     <p>When enabled, this option will pass the Host: line from the incoming
1278     request to the proxied host, instead of the hostname specified in the
1279     <code class="directive">ProxyPass</code> line.</p>
1280
1281     <p>This option should normally be turned <code>Off</code>. It is mostly 
1282     useful in special configurations like proxied mass name-based virtual
1283     hosting, where the original Host header needs to be evaluated by the
1284     backend server.</p>
1285
1286 </div>
1287 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1288 <div class="directive-section"><h2><a name="ProxyReceiveBufferSize" id="ProxyReceiveBufferSize">ProxyReceiveBufferSize</a> <a name="proxyreceivebuffersize" id="proxyreceivebuffersize">Directive</a></h2>
1289 <table class="directive">
1290 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Network buffer size for proxied HTTP and FTP
1291 connections</td></tr>
1292 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyReceiveBufferSize <var>bytes</var></code></td></tr>
1293 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyReceiveBufferSize 0</code></td></tr>
1294 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1295 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1296 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1297 </table>
1298     <p>The <code class="directive">ProxyReceiveBufferSize</code> directive specifies an
1299     explicit (TCP/IP) network buffer size for proxied HTTP and FTP connections,
1300     for increased throughput. It has to be greater than <code>512</code> or set
1301     to <code>0</code> to indicate that the system's default buffer size should
1302     be used.</p>
1303
1304     <div class="example"><h3>Example</h3><p><code>
1305       ProxyReceiveBufferSize 2048
1306     </code></p></div>
1307
1308 </div>
1309 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1310 <div class="directive-section"><h2><a name="ProxyRemote" id="ProxyRemote">ProxyRemote</a> <a name="proxyremote" id="proxyremote">Directive</a></h2>
1311 <table class="directive">
1312 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Remote proxy used to handle certain requests</td></tr>
1313 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRemote <var>match</var> <var>remote-server</var></code></td></tr>
1314 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1315 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1316 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1317 </table>
1318     <p>This defines remote proxies to this proxy. <var>match</var> is either the
1319     name of a URL-scheme that the remote server supports, or a partial URL
1320     for which the remote server should be used, or <code>*</code> to indicate
1321     the server should be contacted for all requests. <var>remote-server</var> is
1322     a partial URL for the remote server. Syntax:</p>
1323
1324     <div class="example"><p><code>
1325       <dfn>remote-server</dfn> =
1326           <var>scheme</var>://<var>hostname</var>[:<var>port</var>]
1327     </code></p></div>
1328
1329     <p><var>scheme</var> is effectively the protocol that should be used to
1330     communicate with the remote server; only <code>http</code> is supported by
1331     this module.</p>
1332
1333     <div class="example"><h3>Example</h3><p><code>
1334       ProxyRemote http://goodguys.example.com/ http://mirrorguys.example.com:8000<br />
1335       ProxyRemote * http://cleverproxy.localdomain<br />
1336       ProxyRemote ftp http://ftpproxy.mydomain:8080
1337     </code></p></div>
1338
1339     <p>In the last example, the proxy will forward FTP requests, encapsulated
1340     as yet another HTTP proxy request, to another proxy which can handle
1341     them.</p>
1342
1343     <p>This option also supports reverse proxy configuration - a backend
1344     webserver can be embedded within a virtualhost URL space even if that
1345     server is hidden by another forward proxy.</p>
1346
1347 </div>
1348 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1349 <div class="directive-section"><h2><a name="ProxyRemoteMatch" id="ProxyRemoteMatch">ProxyRemoteMatch</a> <a name="proxyremotematch" id="proxyremotematch">Directive</a></h2>
1350 <table class="directive">
1351 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Remote proxy used to handle requests matched by regular
1352 expressions</td></tr>
1353 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRemoteMatch <var>regex</var> <var>remote-server</var></code></td></tr>
1354 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1355 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1356 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1357 </table>
1358     <p>The <code class="directive">ProxyRemoteMatch</code> is identical to the
1359     <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> directive, except the
1360     first argument is a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
1361     match against the requested URL.</p>
1362
1363 </div>
1364 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1365 <div class="directive-section"><h2><a name="ProxyRequests" id="ProxyRequests">ProxyRequests</a> <a name="proxyrequests" id="proxyrequests">Directive</a></h2>
1366 <table class="directive">
1367 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables forward (standard) proxy requests</td></tr>
1368 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRequests On|Off</code></td></tr>
1369 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyRequests Off</code></td></tr>
1370 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1371 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1372 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1373 </table>
1374     <p>This allows or prevents Apache from functioning as a forward proxy
1375     server. (Setting ProxyRequests to <code>Off</code> does not disable use of
1376     the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.)</p>
1377
1378     <p>In a typical reverse proxy or gateway configuration, this
1379     option should be set to
1380     <code>Off</code>.</p>
1381
1382     <p>In order to get the functionality of proxying HTTP or FTP sites, you
1383     need also <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code> or <code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code>
1384     (or both) present in the server.</p>
1385
1386     <div class="warning"><h3>Warning</h3>
1387       <p>Do not enable proxying with <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> until you have <a href="#access">secured your server</a>.  Open proxy servers are dangerous
1388       both to your network and to the Internet at large.</p>
1389     </div>
1390
1391 <h3>See also</h3>
1392 <ul>
1393 <li><a href="#forwardreverse">Forward and Reverse Proxies/Gateways</a></li>
1394 </ul>
1395 </div>
1396 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1397 <div class="directive-section"><h2><a name="ProxySet" id="ProxySet">ProxySet</a> <a name="proxyset" id="proxyset">Directive</a></h2>
1398 <table class="directive">
1399 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Set various Proxy balancer or member parameters</td></tr>
1400 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxySet <var>url</var> <var>key=value [key=value ...]</var></code></td></tr>
1401 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
1402 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1403 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1404 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>ProxySet is only available in Apache 2.2
1405   and later.</td></tr>
1406 </table>
1407     <p>This directive is used as an alternate method of setting any of the
1408     parameters available to Proxy balancers and workers normally done via the
1409     <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive. If used
1410     within a <code>&lt;Proxy <var>balancer url|worker url</var>&gt;</code>
1411     container directive, the <var>url</var> argument is not required. As a side
1412     effect the respective balancer or worker gets created. This can be useful
1413     when doing reverse proxying via a
1414     <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> instead of a
1415     <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
1416
1417     <div class="example"><p><code>
1418       &lt;Proxy balancer://hotcluster&gt;<br />
1419       <span class="indent">
1420         BalancerMember http://www2.example.com:8009 loadfactor=1<br />
1421         BalancerMember http://www3.example.com:8009 loadfactor=2<br />
1422         ProxySet lbmethod=bytraffic<br />
1423       </span>
1424       &lt;/Proxy&gt;
1425     </code></p></div>
1426
1427     <div class="example"><p><code>
1428       &lt;Proxy http://backend&gt;<br />
1429       <span class="indent">
1430         ProxySet keepalive=On<br />
1431       </span>
1432       &lt;/Proxy&gt;
1433     </code></p></div>
1434
1435     <div class="example"><p><code>
1436         ProxySet balancer://foo lbmethod=bytraffic timeout=15
1437     </code></p></div>
1438
1439     <div class="example"><p><code>
1440         ProxySet ajp://backend:7001 timeout=15
1441     </code></p></div>
1442
1443    <div class="warning"><h3>Warning</h3>
1444       <p>Keep in mind that the same parameter key can have a different meaning
1445       depending whether it is applied to a balancer or a worker as shown by the two
1446       examples above regarding timeout.</p>
1447    </div>
1448
1449
1450 </div>
1451 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1452 <div class="directive-section"><h2><a name="ProxyStatus" id="ProxyStatus">ProxyStatus</a> <a name="proxystatus" id="proxystatus">Directive</a></h2>
1453 <table class="directive">
1454 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Show Proxy LoadBalancer status in mod_status</td></tr>
1455 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyStatus Off|On|Full</code></td></tr>
1456 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyStatus Off</code></td></tr>
1457 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1458 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1459 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1460 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.2 and later</td></tr>
1461 </table>
1462     <p>This directive determines whether or not proxy
1463     loadbalancer status data is displayed via the <code class="module"><a href="../mod/mod_status.html">mod_status</a></code>
1464     server-status page.</p>
1465     <div class="note"><h3>Note</h3>
1466       <p><strong>Full</strong> is synonymous with <strong>On</strong></p>
1467     </div>
1468
1469
1470 </div>
1471 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1472 <div class="directive-section"><h2><a name="ProxyTimeout" id="ProxyTimeout">ProxyTimeout</a> <a name="proxytimeout" id="proxytimeout">Directive</a></h2>
1473 <table class="directive">
1474 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Network timeout for proxied requests</td></tr>
1475 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyTimeout <var>seconds</var></code></td></tr>
1476 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Value of <code class="directive"><a href="../mod/core.html#timeout">Timeout</a></code></code></td></tr>
1477 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1478 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1479 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1480 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.31 and later</td></tr>
1481 </table>
1482     <p>This directive allows a user to specifiy a timeout on proxy requests.
1483     This is useful when you have a slow/buggy appserver which hangs, and you
1484     would rather just return a timeout and fail gracefully instead of waiting
1485     however long it takes the server to return.</p>
1486
1487 </div>
1488 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1489 <div class="directive-section"><h2><a name="ProxyVia" id="ProxyVia">ProxyVia</a> <a name="proxyvia" id="proxyvia">Directive</a></h2>
1490 <table class="directive">
1491 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Information provided in the <code>Via</code> HTTP response
1492 header for proxied requests</td></tr>
1493 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyVia On|Off|Full|Block</code></td></tr>
1494 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyVia Off</code></td></tr>
1495 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1496 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1497 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1498 </table>
1499     <p>This directive controls the use of the <code>Via:</code> HTTP
1500     header by the proxy. Its intended use is to control the flow of
1501     proxy requests along a chain of proxy servers.  See <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616</a> (HTTP/1.1), section
1502     14.45 for an explanation of <code>Via:</code> header lines.</p>
1503
1504     <ul>
1505     <li>If set to <code>Off</code>, which is the default, no special processing
1506     is performed. If a request or reply contains a <code>Via:</code> header,
1507     it is passed through unchanged.</li>
1508
1509     <li>If set to <code>On</code>, each request and reply will get a
1510     <code>Via:</code> header line added for the current host.</li>
1511
1512     <li>If set to <code>Full</code>, each generated <code>Via:</code> header
1513     line will additionally have the Apache server version shown as a
1514     <code>Via:</code> comment field.</li>
1515
1516     <li>If set to <code>Block</code>, every proxy request will have all its
1517     <code>Via:</code> header lines removed. No new <code>Via:</code> header will
1518     be generated.</li>
1519     </ul>
1520
1521 </div>
1522 </div>
1523 <div class="bottomlang">
1524 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy.html" title="English">&nbsp;en&nbsp;</a> |
1525 <a href="../fr/mod/mod_proxy.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
1526 <a href="../ja/mod/mod_proxy.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
1527 </div><div id="footer">
1528 <p class="apache">Copyright 2009 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
1529 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
1530 </body></html>