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