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