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