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