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