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