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
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" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.5</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
20 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.5</a> > <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_proxy</h1>
24 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy.html" title="English"> en </a> |
25 <a href="../fr/mod/mod_proxy.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
26 <a href="../ja/mod/mod_proxy.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
28 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Multi-protocol proxy/gateway server</td></tr>
29 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
30 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>proxy_module</td></tr>
31 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_proxy.c</td></tr></table>
34 <div class="warning"><h3>Warning</h3>
35 <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
36 network and to the Internet at large.</p>
39 <p><code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> and related modules implement a
40 proxy/gateway for Apache HTTP Server, supporting a number of popular
41 protocols as well as several different load balancing algorithms.
42 Third-party modules can add support for additional protocols and
43 load balancing algorithms.</p>
45 <p>A set of modules must be loaded into the server to provide the
46 necessary features. These modules can be included statically at
47 build time or dynamically via the
48 <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code> directive).
49 The set must include:</p>
52 <li><code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>, which provides basic proxy
55 <li><code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code> and one or more
56 balancer modules, if load balancing is required. (See
57 <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code> for more information.)</li>
59 <li>one or more proxy scheme, or protocol, modules:
61 <table class="bordered">
62 <tr><th>Protocol</th><th>Module</th></tr>
63 <tr><td>AJP13 (Apache JServe Protocol version
64 1.3)</td><td><code class="module"><a href="../mod/mod_proxy_ajp.html">mod_proxy_ajp</a></code></td></tr>
66 SSL)</td><td><code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code></td></tr>
67 <tr><td>FastCGI</td><td><code class="module"><a href="../mod/mod_proxy_fcgi.html">mod_proxy_fcgi</a></code></td></tr>
68 <tr><td>ftp</td><td><code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code></td></tr>
69 <tr><td>HTTP/0.9, HTTP/1.0, and
70 HTTP/1.1</td><td><code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code></td></tr>
71 <tr><td>SCGI</td><td><code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code></td></tr>
76 <p>In addition, extended features are provided by other modules.
77 Caching is provided by <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> and related
78 modules. The ability to contact remote servers using the SSL/TLS
79 protocol is provided by the <code>SSLProxy*</code> directives of
80 <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>. These additional modules will need
81 to be loaded and configured to take advantage of these features.</p>
83 <div id="quickview"><h3 class="directives">Directives</h3>
85 <li><img alt="" src="../images/down.gif" /> <a href="#balancergrowth">BalancerGrowth</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#balancermember">BalancerMember</a></li>
87 <li><img alt="" src="../images/down.gif" /> <a href="#noproxy">NoProxy</a></li>
88 <li><img alt="" src="../images/down.gif" /> <a href="#proxy"><Proxy></a></li>
89 <li><img alt="" src="../images/down.gif" /> <a href="#proxyaddheaders">ProxyAddHeaders</a></li>
90 <li><img alt="" src="../images/down.gif" /> <a href="#proxybadheader">ProxyBadHeader</a></li>
91 <li><img alt="" src="../images/down.gif" /> <a href="#proxyblock">ProxyBlock</a></li>
92 <li><img alt="" src="../images/down.gif" /> <a href="#proxydomain">ProxyDomain</a></li>
93 <li><img alt="" src="../images/down.gif" /> <a href="#proxyerroroverride">ProxyErrorOverride</a></li>
94 <li><img alt="" src="../images/down.gif" /> <a href="#proxyiobuffersize">ProxyIOBufferSize</a></li>
95 <li><img alt="" src="../images/down.gif" /> <a href="#proxymatch"><ProxyMatch></a></li>
96 <li><img alt="" src="../images/down.gif" /> <a href="#proxymaxforwards">ProxyMaxForwards</a></li>
97 <li><img alt="" src="../images/down.gif" /> <a href="#proxypass">ProxyPass</a></li>
98 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassinterpolateenv">ProxyPassInterpolateEnv</a></li>
99 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassmatch">ProxyPassMatch</a></li>
100 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassreverse">ProxyPassReverse</a></li>
101 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassreversecookiedomain">ProxyPassReverseCookieDomain</a></li>
102 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassreversecookiepath">ProxyPassReverseCookiePath</a></li>
103 <li><img alt="" src="../images/down.gif" /> <a href="#proxypreservehost">ProxyPreserveHost</a></li>
104 <li><img alt="" src="../images/down.gif" /> <a href="#proxyreceivebuffersize">ProxyReceiveBufferSize</a></li>
105 <li><img alt="" src="../images/down.gif" /> <a href="#proxyremote">ProxyRemote</a></li>
106 <li><img alt="" src="../images/down.gif" /> <a href="#proxyremotematch">ProxyRemoteMatch</a></li>
107 <li><img alt="" src="../images/down.gif" /> <a href="#proxyrequests">ProxyRequests</a></li>
108 <li><img alt="" src="../images/down.gif" /> <a href="#proxyset">ProxySet</a></li>
109 <li><img alt="" src="../images/down.gif" /> <a href="#proxysourceaddress">ProxySourceAddress</a></li>
110 <li><img alt="" src="../images/down.gif" /> <a href="#proxystatus">ProxyStatus</a></li>
111 <li><img alt="" src="../images/down.gif" /> <a href="#proxytimeout">ProxyTimeout</a></li>
112 <li><img alt="" src="../images/down.gif" /> <a href="#proxyvia">ProxyVia</a></li>
116 <li><img alt="" src="../images/down.gif" /> <a href="#forwardreverse">Forward Proxies and Reverse
117 Proxies/Gateways</a></li>
118 <li><img alt="" src="../images/down.gif" /> <a href="#examples">Basic Examples</a></li>
119 <li><img alt="" src="../images/down.gif" /> <a href="#workers">Workers</a></li>
120 <li><img alt="" src="../images/down.gif" /> <a href="#access">Controlling access to your proxy</a></li>
121 <li><img alt="" src="../images/down.gif" /> <a href="#startup">Slow Startup</a></li>
122 <li><img alt="" src="../images/down.gif" /> <a href="#intranet">Intranet Proxy</a></li>
123 <li><img alt="" src="../images/down.gif" /> <a href="#envsettings">Protocol Adjustments</a></li>
124 <li><img alt="" src="../images/down.gif" /> <a href="#request-bodies">Request Bodies</a></li>
125 <li><img alt="" src="../images/down.gif" /> <a href="#x-headers">Reverse Proxy Request Headers</a></li>
126 </ul><h3>See also</h3>
128 <li><code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code></li>
129 <li><code class="module"><a href="../mod/mod_proxy_ajp.html">mod_proxy_ajp</a></code></li>
130 <li><code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code></li>
131 <li><code class="module"><a href="../mod/mod_proxy_fcgi.html">mod_proxy_fcgi</a></code></li>
132 <li><code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code></li>
133 <li><code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code></li>
134 <li><code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code></li>
135 <li><code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code></li>
136 <li><code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code></li>
138 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
139 <div class="section">
140 <h2><a name="forwardreverse" id="forwardreverse">Forward Proxies and Reverse
141 Proxies/Gateways</a></h2>
142 <p>Apache HTTP Server can be configured in both a <dfn>forward</dfn> and
143 <dfn>reverse</dfn> proxy (also known as <dfn>gateway</dfn>) mode.</p>
145 <p>An ordinary <dfn>forward proxy</dfn> is an intermediate
146 server that sits between the client and the <em>origin
147 server</em>. In order to get content from the origin server,
148 the client sends a request to the proxy naming the origin server
149 as the target and the proxy then requests the content from the
150 origin server and returns it to the client. The client must be
151 specially configured to use the forward proxy to access other
154 <p>A typical usage of a forward proxy is to provide Internet
155 access to internal clients that are otherwise restricted by a
156 firewall. The forward proxy can also use caching (as provided
157 by <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>) to reduce network usage.</p>
159 <p>The forward proxy is activated using the <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive. Because
160 forward proxies allow clients to access arbitrary sites through
161 your server and to hide their true origin, it is essential that
162 you <a href="#access">secure your server</a> so that only
163 authorized clients can access the proxy before activating a
166 <p>A <dfn>reverse proxy</dfn> (or <dfn>gateway</dfn>), by
167 contrast, appears to the client just like an ordinary web
168 server. No special configuration on the client is necessary.
169 The client makes ordinary requests for content in the name-space
170 of the reverse proxy. The reverse proxy then decides where to
171 send those requests, and returns the content as if it was itself
174 <p>A typical usage of a reverse proxy is to provide Internet
175 users access to a server that is behind a firewall. Reverse
176 proxies can also be used to balance load among several back-end
177 servers, or to provide caching for a slower back-end server.
178 In addition, reverse proxies can be used simply to bring
179 several servers into the same URL space.</p>
181 <p>A reverse proxy is activated using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive or the
182 <code>[P]</code> flag to the <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directive. It is
183 <strong>not</strong> necessary to turn <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> on in order to
184 configure a reverse proxy.</p>
185 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
186 <div class="section">
187 <h2><a name="examples" id="examples">Basic Examples</a></h2>
189 <p>The examples below are only a very basic idea to help you
190 get started. Please read the documentation on the individual
193 <p>In addition, if you wish to have caching enabled, consult
194 the documentation from <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>.</p>
196 <div class="example"><h3>Reverse Proxy</h3><p><code>
197 ProxyPass /foo http://foo.example.com/bar<br />
198 ProxyPassReverse /foo http://foo.example.com/bar
201 <div class="example"><h3>Forward Proxy</h3><p><code>
202 ProxyRequests On<br />
205 <Proxy *><br />
206 <span class="indent">
207 Require host internal.example.com<br />
211 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
212 <div class="section">
213 <h2><a name="workers" id="workers">Workers</a></h2>
214 <p>The proxy manages the configuration of origin servers and their
215 communication parameters in objects called <dfn>workers</dfn>.
216 There are two built-in workers, the default forward proxy worker and the
217 default reverse proxy worker. Additional workers can be configured
220 <p>The two default workers have a fixed configuration
221 and will be used if no other worker matches the request.
222 They do not use HTTP Keep-Alive or connection pooling.
223 The TCP connections to the origin server will instead be
224 opened and closed for each request.</p>
226 <p>Explicitly configured workers are identified by their URL.
227 They are usually created and configured using
228 <code class="directive"><a href="#proxypass">ProxyPass</a></code> or
229 <code class="directive"><a href="#proxypassmatch">ProxyPassMatch</a></code> when used
230 for a reverse proxy:</p>
232 <div class="example"><p><code>
233 ProxyPass /example http://backend.example.com connectiontimeout=5 timeout=30
236 <p>This will create a worker associated with the origin server URL
237 <code>http://backend.example.com</code> and using the given timeout
238 values. When used in a forward proxy, workers are usually defined
239 via the <code class="directive"><a href="#proxyset">ProxySet</a></code> directive:</p>
241 <div class="example"><p><code>
242 ProxySet http://backend.example.com connectiontimeout=5 timeout=30
245 <p>or alternatively using <code class="directive"><a href="#proxy">Proxy</a></code>
246 and <code class="directive"><a href="#proxyset">ProxySet</a></code>:</p>
248 <div class="example"><p><code>
249 <Proxy http://backend.example.com><br />
250 <span class="indent">
251 ProxySet connectiontimeout=5 timeout=30
256 <p>Using explicitly configured workers in the forward mode is
257 not very common, because forward proxies usually communicate with many
258 different origin servers. Creating explicit workers for some of the
259 origin servers can still be useful, if they are used very often.
260 Explicitly configured workers have no concept of forward or reverse
261 proxying by themselves. They encapsulate a common concept of
262 communication with origin servers. A worker created by
263 <code class="directive"><a href="#proxypass">ProxyPass</a></code> for use in a
264 reverse proxy will be also used for forward proxy requests whenever
265 the URL to the origin server matches the worker URL and vice versa.</p>
267 <p>The URL identifying a direct worker is the URL of its
268 origin server including any path components given:</p>
270 <div class="example"><p><code>
271 ProxyPass /examples http://backend.example.com/examples<br />
272 ProxyPass /docs http://backend.example.com/docs
275 <p>This example defines two different workers, each using a separate
276 connection pool and configuration.</p>
278 <div class="warning"><h3>Worker Sharing</h3>
279 <p>Worker sharing happens if the worker URLs overlap, which occurs when
280 the URL of some worker is a leading substring of the URL of another
281 worker defined later in the configuration file. In the following example</p>
283 <div class="example"><p><code>
284 ProxyPass /apps http://backend.example.com/ timeout=60<br />
285 ProxyPass /examples http://backend.example.com/examples timeout=10
288 <p>the second worker isn't actually created. Instead the first
289 worker is used. The benefit is, that there is only one connection pool,
290 so connections are more often reused. Note that all configuration attributes
291 given explicitly for the later worker will be ignored. This will be logged
292 as a warning. In the above example the resulting timeout value
293 for the URL <code>/examples</code> will be <code>60</code> instead
294 of <code>10</code>!</p>
296 <p>If you want to avoid worker sharing, sort your worker definitions
297 by URL length, starting with the longest worker URLs. If you want to maximize
298 worker sharing use the reverse sort order. See also the related warning about
299 ordering <code class="directive"><a href="#proxypass">ProxyPass</a></code> directives.</p>
303 <p>Explicitly configured workers come in two flavors:
304 <dfn>direct workers</dfn> and <dfn>(load) balancer workers</dfn>.
305 They support many important configuration attributes which are
306 described below in the <code class="directive"><a href="#proxypass">ProxyPass</a></code>
307 directive. The same attributes can also be set using
308 <code class="directive"><a href="#proxyset">ProxySet</a></code>.</p>
310 <p>The set of options available for a direct worker
311 depends on the protocol, which is specified in the origin server URL.
312 Available protocols include <code>ajp</code>, <code>fcgi</code>,
313 <code>ftp</code>, <code>http</code> and <code>scgi</code>.</p>
315 <p>Balancer workers are virtual workers that use direct workers known
316 as their members to actually handle the requests. Each balancer can
317 have multiple members. When it handles a request, it chooses a member
318 based on the configured load balancing algorithm.</p>
320 <p>A balancer worker is created if its worker URL uses
321 <code>balancer</code> as the protocol scheme.
322 The balancer URL uniquely identifies the balancer worker.
323 Members are added to a balancer using
324 <code class="directive"><a href="#balancermember">BalancerMember</a></code>.</p>
326 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
327 <div class="section">
328 <h2><a name="access" id="access">Controlling access to your proxy</a></h2>
329 <p>You can control who can access your proxy via the <code class="directive"><a href="#proxy"><Proxy></a></code> control block as in
330 the following example:</p>
332 <div class="example"><p><code>
333 <Proxy *><br />
334 <span class="indent">
335 Require ip 192.168.0<br />
340 <p>For more information on access control directives, see
341 <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code>.</p>
343 <p>Strictly limiting access is essential if you are using a
344 forward proxy (using the <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive).
345 Otherwise, your server can be used by any client to access
346 arbitrary hosts while hiding his or her true identity. This is
347 dangerous both for your network and for the Internet at large.
348 When using a reverse proxy (using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive with
349 <code>ProxyRequests Off</code>), access control is less
350 critical because clients can only contact the hosts that you
351 have specifically configured.</p>
353 <p><strong>See Also</strong> the <a href="mod_proxy_http.html#env">Proxy-Chain-Auth</a> environment variable.</p>
355 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
356 <div class="section">
357 <h2><a name="startup" id="startup">Slow Startup</a></h2>
358 <p>If you're using the <code class="directive"><a href="#proxyblock">ProxyBlock</a></code> directive, hostnames' IP addresses are looked up
359 and cached during startup for later match test. This may take a few
360 seconds (or more) depending on the speed with which the hostname lookups
362 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
363 <div class="section">
364 <h2><a name="intranet" id="intranet">Intranet Proxy</a></h2>
365 <p>An Apache httpd proxy server situated in an intranet needs to forward
366 external requests through the company's firewall (for this, configure
367 the <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> directive
368 to forward the respective <var>scheme</var> to the firewall proxy).
369 However, when it has to
370 access resources within the intranet, it can bypass the firewall when
371 accessing hosts. The <code class="directive"><a href="#noproxy">NoProxy</a></code>
372 directive is useful for specifying which hosts belong to the intranet and
373 should be accessed directly.</p>
375 <p>Users within an intranet tend to omit the local domain name from their
376 WWW requests, thus requesting "http://somehost/" instead of
377 <code>http://somehost.example.com/</code>. Some commercial proxy servers
378 let them get away with this and simply serve the request, implying a
379 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
380 a redirect response and send the client to the correct, fully qualified,
381 server address. This is the preferred method since the user's bookmark
382 files will then contain fully qualified hosts.</p>
383 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
384 <div class="section">
385 <h2><a name="envsettings" id="envsettings">Protocol Adjustments</a></h2>
386 <p>For circumstances where <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> is sending
387 requests to an origin server that doesn't properly implement
388 keepalives or HTTP/1.1, there are two <a href="../env.html">environment variables</a> that can force the
389 request to use HTTP/1.0 with no keepalive. These are set via the
390 <code class="directive"><a href="../mod/mod_env.html#setenv">SetEnv</a></code> directive.</p>
392 <p>These are the <code>force-proxy-request-1.0</code> and
393 <code>proxy-nokeepalive</code> notes.</p>
395 <div class="example"><p><code>
396 <Location /buggyappserver/><br />
397 <span class="indent">
398 ProxyPass http://buggyappserver:7001/foo/<br />
399 SetEnv force-proxy-request-1.0 1<br />
400 SetEnv proxy-nokeepalive 1<br />
405 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
406 <div class="section">
407 <h2><a name="request-bodies" id="request-bodies">Request Bodies</a></h2>
409 <p>Some request methods such as POST include a request body.
410 The HTTP protocol requires that requests which include a body
411 either use chunked transfer encoding or send a
412 <code>Content-Length</code> request header. When passing these
413 requests on to the origin server, <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code>
414 will always attempt to send the <code>Content-Length</code>. But
415 if the body is large and the original request used chunked
416 encoding, then chunked encoding may also be used in the upstream
417 request. You can control this selection using <a href="../env.html">environment variables</a>. Setting
418 <code>proxy-sendcl</code> ensures maximum compatibility with
419 upstream servers by always sending the
420 <code>Content-Length</code>, while setting
421 <code>proxy-sendchunked</code> minimizes resource usage by using
422 chunked encoding.</p>
424 <p>Under some circumstances, the server must spool request bodies
425 to disk to satisfy the requested handling of request bodies. For
426 example, this spooling will occur if the original body was sent with
427 chunked encoding (and is large), but the administrator has
428 asked for backend requests to be sent with Content-Length or as HTTP/1.0.
429 This spooling can also occur if the request body already has a
430 Content-Length header, but the server is configured to filter incoming
433 <p><code class="directive"><a href="../mod/core.html#limitrequestbody">LimitRequestBody</a></code> only applies to
434 request bodies that the server will spool to disk</p>
436 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
437 <div class="section">
438 <h2><a name="x-headers" id="x-headers">Reverse Proxy Request Headers</a></h2>
440 <p>When acting in a reverse-proxy mode (using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive, for example),
441 <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code> adds several request headers in
442 order to pass information to the origin server. These headers
446 <dt><code>X-Forwarded-For</code></dt>
447 <dd>The IP address of the client.</dd>
448 <dt><code>X-Forwarded-Host</code></dt>
449 <dd>The original host requested by the client in the <code>Host</code>
450 HTTP request header.</dd>
451 <dt><code>X-Forwarded-Server</code></dt>
452 <dd>The hostname of the proxy server.</dd>
455 <p>Be careful when using these headers on the origin server, since
456 they will contain more than one (comma-separated) value if the
457 original request already contained one of these headers. For
458 example, you can use <code>%{X-Forwarded-For}i</code> in the log
459 format string of the origin server to log the original clients IP
460 address, but you may get more than one address if the request
461 passes through several proxies.</p>
463 <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
464 other request headers.</p>
467 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
468 <div class="directive-section"><h2><a name="BalancerGrowth" id="BalancerGrowth">BalancerGrowth</a> <a name="balancergrowth" id="balancergrowth">Directive</a></h2>
469 <table class="directive">
470 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of additional Balancers that can be added Post-configuration</td></tr>
471 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>BalancerGrowth <var>#</var></code></td></tr>
472 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>BalancerGrowth 5</code></td></tr>
473 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
474 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
475 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
476 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>BalancerGrowth is only available in Apache HTTP Server 2.3.13
479 <p>This directive allows for growth potential in the number of
480 Balancers available for a virtualhost in addition to the
481 number pre-configured. It only take effect if there is at
482 least 1 pre-configured Balancer.</p>
485 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
486 <div class="directive-section"><h2><a name="BalancerMember" id="BalancerMember">BalancerMember</a> <a name="balancermember" id="balancermember">Directive</a></h2>
487 <table class="directive">
488 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Add a member to a load balancing group</td></tr>
489 <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>
490 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
491 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
492 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
493 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>BalancerMember is only available in Apache HTTP Server 2.2
496 <p>This directive adds a member to a load balancing group. It could be used
497 within a <code><Proxy <var>balancer://</var>...></code> container
498 directive, and can take any of the key value pair parameters available to
499 <code class="directive"><a href="#proxypass">ProxyPass</a></code> directives.</p>
500 <p>One additional parameter is available only to <code class="directive"><a href="#balancermember">BalancerMember</a></code> directives:
501 <var>loadfactor</var>. This is the member load factor - a number between 1
502 (default) and 100, which defines the weighted load to be applied to the
503 member in question.</p>
504 <p>The balancerurl is only needed when not in <code><Proxy <var>balancer://</var>...></code>
505 container directive. It corresponds to the url of a balancer defined in
506 <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
509 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
510 <div class="directive-section"><h2><a name="NoProxy" id="NoProxy">NoProxy</a> <a name="noproxy" id="noproxy">Directive</a></h2>
511 <table class="directive">
512 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hosts, domains, or networks that will be connected to
514 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NoProxy <var>host</var> [<var>host</var>] ...</code></td></tr>
515 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
516 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
517 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
519 <p>This directive is only useful for Apache httpd proxy servers within
520 intranets. The <code class="directive">NoProxy</code> directive specifies a
521 list of subnets, IP addresses, hosts and/or domains, separated by
522 spaces. A request to a host which matches one or more of these is
523 always served directly, without forwarding to the configured
524 <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> proxy server(s).</p>
526 <div class="example"><h3>Example</h3><p><code>
527 ProxyRemote * http://firewall.example.com:81<br />
528 NoProxy .example.com 192.168.112.0/21
531 <p>The <var>host</var> arguments to the <code class="directive">NoProxy</code>
532 directive are one of the following type list:</p>
536 <dt><var><a name="domain" id="domain">Domain</a></var></dt>
538 <p>A <dfn>Domain</dfn> is a partially qualified DNS domain name, preceded
539 by a period. It represents a list of hosts which logically belong to the
540 same DNS domain or zone (<em>i.e.</em>, the suffixes of the hostnames are
541 all ending in <var>Domain</var>).</p>
543 <div class="example"><h3>Examples</h3><p><code>
547 <p>To distinguish <var>Domain</var>s from <var><a href="#hostname">Hostname</a></var>s (both syntactically and semantically; a DNS domain can
548 have a DNS A record, too!), <var>Domain</var>s are always written with a
551 <div class="note"><h3>Note</h3>
552 <p>Domain name comparisons are done without regard to the case, and
553 <var>Domain</var>s are always assumed to be anchored in the root of the
554 DNS tree, therefore two domains <code>.ExAmple.com</code> and
555 <code>.example.com.</code> (note the trailing period) are considered
556 equal. Since a domain comparison does not involve a DNS lookup, it is much
557 more efficient than subnet comparison.</p>
561 <dt><var><a name="subnet" id="subnet">SubNet</a></var></dt>
563 <p>A <dfn>SubNet</dfn> is a partially qualified internet address in
564 numeric (dotted quad) form, optionally followed by a slash and the netmask,
565 specified as the number of significant bits in the <var>SubNet</var>. It is
566 used to represent a subnet of hosts which can be reached over a common
567 network interface. In the absence of the explicit net mask it is assumed
568 that omitted (or zero valued) trailing digits specify the mask. (In this
569 case, the netmask can only be multiples of 8 bits wide.) Examples:</p>
572 <dt><code>192.168</code> or <code>192.168.0.0</code></dt>
573 <dd>the subnet 192.168.0.0 with an implied netmask of 16 valid bits
574 (sometimes used in the netmask form <code>255.255.0.0</code>)</dd>
575 <dt><code>192.168.112.0/21</code></dt>
576 <dd>the subnet <code>192.168.112.0/21</code> with a netmask of 21
577 valid bits (also used in the form <code>255.255.248.0</code>)</dd>
580 <p>As a degenerate case, a <em>SubNet</em> with 32 valid bits is the
581 equivalent to an <var><a href="#ipadr">IPAddr</a></var>, while a <var>SubNet</var> with zero
582 valid bits (<em>e.g.</em>, 0.0.0.0/0) is the same as the constant
583 <var>_Default_</var>, matching any IP address.</p></dd>
586 <dt><var><a name="ipaddr" id="ipaddr">IPAddr</a></var></dt>
588 <p>A <dfn>IPAddr</dfn> represents a fully qualified internet address in
589 numeric (dotted quad) form. Usually, this address represents a host, but
590 there need not necessarily be a DNS domain name connected with the
592 <div class="example"><h3>Example</h3><p><code>
596 <div class="note"><h3>Note</h3>
597 <p>An <var>IPAddr</var> does not need to be resolved by the DNS system, so
598 it can result in more effective apache performance.</p>
602 <dt><var><a name="hostname" id="hostname">Hostname</a></var></dt>
604 <p>A <dfn>Hostname</dfn> is a fully qualified DNS domain name which can
605 be resolved to one or more <var><a href="#ipaddr">IPAddrs</a></var> via the
606 DNS domain name service. It represents a logical host (in contrast to
607 <var><a href="#domain">Domain</a></var>s, see above) and must be resolvable
608 to at least one <var><a href="#ipaddr">IPAddr</a></var> (or often to a list
609 of hosts with different <var><a href="#ipaddr">IPAddr</a></var>s).</p>
611 <div class="example"><h3>Examples</h3><p><code>
612 prep.ai.example.edu<br />
616 <div class="note"><h3>Note</h3>
617 <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
618 DNS lookup can be avoided. Name resolution in Apache httpd can take a remarkable
619 deal of time when the connection to the name server uses a slow PPP
621 <p><var>Hostname</var> comparisons are done without regard to the case,
622 and <var>Hostname</var>s are always assumed to be anchored in the root
623 of the DNS tree, therefore two hosts <code>WWW.ExAmple.com</code>
624 and <code>www.example.com.</code> (note the trailing period) are
625 considered equal.</p>
631 <li><a href="../dns-caveats.html">DNS Issues</a></li>
634 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
635 <div class="directive-section"><h2><a name="Proxy" id="Proxy"><Proxy></a> <a name="proxy" id="proxy">Directive</a></h2>
636 <table class="directive">
637 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Container for directives applied to proxied resources</td></tr>
638 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Proxy <var>wildcard-url</var>> ...</Proxy></code></td></tr>
639 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
640 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
641 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
643 <p>Directives placed in <code class="directive"><Proxy></code>
644 sections apply only to matching proxied content. Shell-style wildcards are
647 <p>For example, the following will allow only hosts in
648 <code>yournetwork.example.com</code> to access content via your proxy
651 <div class="example"><p><code>
652 <Proxy *><br />
653 <span class="indent">
654 Require host yournetwork.example.com<br />
659 <p>The following example will process all files in the <code>foo</code>
660 directory of <code>example.com</code> through the <code>INCLUDES</code>
661 filter when they are sent through the proxy server:</p>
663 <div class="example"><p><code>
664 <Proxy http://example.com/foo/*><br />
665 <span class="indent">
666 SetOutputFilter INCLUDES<br />
674 <li><code class="directive"><a href="#proxymatch"><ProxyMatch></a></code></li>
677 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
678 <div class="directive-section"><h2><a name="ProxyAddHeaders" id="ProxyAddHeaders">ProxyAddHeaders</a> <a name="proxyaddheaders" id="proxyaddheaders">Directive</a></h2>
679 <table class="directive">
680 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Add proxy information in X-Forwarded-* headers</td></tr>
681 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyAddHeaders Off|On</code></td></tr>
682 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyAddHeaders On</code></td></tr>
683 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
684 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
685 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
686 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.3.10 and later</td></tr>
688 <p>This directive determines whether or not proxy related information should be passed to the
689 backend server through X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Server HTTP headers.</p>
690 <div class="note"><h3>Effectiveness</h3>
691 <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>
695 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
696 <div class="directive-section"><h2><a name="ProxyBadHeader" id="ProxyBadHeader">ProxyBadHeader</a> <a name="proxybadheader" id="proxybadheader">Directive</a></h2>
697 <table class="directive">
698 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines how to handle bad header lines in a
700 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyBadHeader IsError|Ignore|StartBody</code></td></tr>
701 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyBadHeader IsError</code></td></tr>
702 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
703 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
704 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
705 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache HTTP Server 2.0.44 and later</td></tr>
707 <p>The <code class="directive">ProxyBadHeader</code> directive determines the
708 behaviour of <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> if it receives syntactically invalid
709 response header lines (<em>i.e.</em> containing no colon) from the origin
710 server. The following arguments are possible:</p>
713 <dt><code>IsError</code></dt>
714 <dd>Abort the request and end up with a 502 (Bad Gateway) response. This is
715 the default behaviour.</dd>
717 <dt><code>Ignore</code></dt>
718 <dd>Treat bad header lines as if they weren't sent.</dd>
720 <dt><code>StartBody</code></dt>
721 <dd>When receiving the first bad header line, finish reading the headers and
722 treat the remainder as body. This helps to work around buggy backend servers
723 which forget to insert an empty line between the headers and the body.</dd>
727 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
728 <div class="directive-section"><h2><a name="ProxyBlock" id="ProxyBlock">ProxyBlock</a> <a name="proxyblock" id="proxyblock">Directive</a></h2>
729 <table class="directive">
730 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Words, hosts, or domains that are banned from being
732 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyBlock *|<var>word</var>|<var>host</var>|<var>domain</var>
733 [<var>word</var>|<var>host</var>|<var>domain</var>] ...</code></td></tr>
734 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
735 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
736 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
738 <p>The <code class="directive">ProxyBlock</code> directive specifies a list of
739 words, hosts and/or domains, separated by spaces. HTTP, HTTPS, and
740 FTP document requests to sites whose names contain matched words,
741 hosts or domains are <em>blocked</em> by the proxy server. The proxy
742 module will also attempt to determine IP addresses of list items which
743 may be hostnames during startup, and cache them for match test as
744 well. That may slow down the startup time of the server.</p>
746 <div class="example"><h3>Example</h3><p><code>
747 ProxyBlock news.example.com auctions.example.com friends.example.com
750 <p>Note that <code>example</code> would also be sufficient to match any
753 <p>Hosts would also be matched if referenced by IP address.</p>
755 <p>Note also that</p>
757 <div class="example"><p><code>
761 <p>blocks connections to all sites.</p>
764 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
765 <div class="directive-section"><h2><a name="ProxyDomain" id="ProxyDomain">ProxyDomain</a> <a name="proxydomain" id="proxydomain">Directive</a></h2>
766 <table class="directive">
767 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default domain name for proxied requests</td></tr>
768 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyDomain <var>Domain</var></code></td></tr>
769 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
770 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
771 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
773 <p>This directive is only useful for Apache httpd proxy servers within
774 intranets. The <code class="directive">ProxyDomain</code> directive specifies
775 the default domain which the apache proxy server will belong to. If a
776 request to a host without a domain name is encountered, a redirection
777 response to the same host with the configured <var>Domain</var> appended
778 will be generated.</p>
780 <div class="example"><h3>Example</h3><p><code>
781 ProxyRemote * http://firewall.example.com:81<br />
782 NoProxy .example.com 192.168.112.0/21<br />
783 ProxyDomain .example.com
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="ProxyErrorOverride" id="ProxyErrorOverride">ProxyErrorOverride</a> <a name="proxyerroroverride" id="proxyerroroverride">Directive</a></h2>
789 <table class="directive">
790 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Override error pages for proxied content</td></tr>
791 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyErrorOverride On|Off</code></td></tr>
792 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyErrorOverride Off</code></td></tr>
793 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
794 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
795 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
796 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0 and later</td></tr>
798 <p>This directive is useful for reverse-proxy setups, where you want to
799 have a common look and feel on the error pages seen by the end user.
800 This also allows for included files (via
801 <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>'s SSI) to get
802 the error code and act accordingly (default behavior would display
803 the error page of the proxied server, turning this on shows the SSI
806 <p>This directive does not affect the processing of informational (1xx),
807 normal success (2xx), or redirect (3xx) responses.</p>
810 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
811 <div class="directive-section"><h2><a name="ProxyIOBufferSize" id="ProxyIOBufferSize">ProxyIOBufferSize</a> <a name="proxyiobuffersize" id="proxyiobuffersize">Directive</a></h2>
812 <table class="directive">
813 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine size of internal data throughput buffer</td></tr>
814 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyIOBufferSize <var>bytes</var></code></td></tr>
815 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyIOBufferSize 8192</code></td></tr>
816 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
817 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
818 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
820 <p>The <code class="directive">ProxyIOBufferSize</code> directive adjusts the size
821 of the internal buffer, which is used as a scratchpad for the data between
822 input and output. The size must be at least <code>512</code>.</p>
824 <p>In almost every case there's no reason to change that value.</p>
825 <p>If used with AJP this directive sets the maximum AJP packet size in
826 bytes. If you change it from the default, you must also change the
827 <code>packetSize</code> attribute of your AJP connector on the
828 Tomcat side! The attribute <code>packetSize</code> is only available
829 in Tomcat <code>5.5.20+</code> and <code>6.0.2+</code></p>
830 <p>Normally it is not necessary to change the maximum packet size.
831 Problems with the default value have been reported when sending
832 certificates or certificate chains.</p>
836 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
837 <div class="directive-section"><h2><a name="ProxyMatch" id="ProxyMatch"><ProxyMatch></a> <a name="proxymatch" id="proxymatch">Directive</a></h2>
838 <table class="directive">
839 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Container for directives applied to regular-expression-matched
840 proxied resources</td></tr>
841 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><ProxyMatch <var>regex</var>> ...</ProxyMatch></code></td></tr>
842 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
843 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
844 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
846 <p>The <code class="directive"><ProxyMatch></code> directive is
847 identical to the <code class="directive"><a href="#proxy"><Proxy></a></code> directive, except it matches URLs
848 using <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expressions</a>.</p>
852 <li><code class="directive"><a href="#proxy"><Proxy></a></code></li>
855 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
856 <div class="directive-section"><h2><a name="ProxyMaxForwards" id="ProxyMaxForwards">ProxyMaxForwards</a> <a name="proxymaxforwards" id="proxymaxforwards">Directive</a></h2>
857 <table class="directive">
858 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximium number of proxies that a request can be forwarded
860 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyMaxForwards <var>number</var></code></td></tr>
861 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyMaxForwards -1</code></td></tr>
862 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
863 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
864 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
865 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache HTTP Server 2.0 and later;
866 default behaviour changed in 2.2.7/2.3</td></tr>
868 <p>The <code class="directive">ProxyMaxForwards</code> directive specifies the
869 maximum number of proxies through which a request may pass, if there's no
870 <code>Max-Forwards</code> header supplied with the request. This may
871 be set to prevent infinite proxy loops, or a DoS attack.</p>
873 <div class="example"><h3>Example</h3><p><code>
877 <p>Note that setting <code class="directive">ProxyMaxForwards</code> is a
878 violation of the HTTP/1.1 protocol (RFC2616), which forbids a Proxy
879 setting <code>Max-Forwards</code> if the Client didn't set it.
880 Earlier Apache httpd versions would always set it. A negative
881 <code class="directive">ProxyMaxForwards</code> value, including the
882 default -1, gives you protocol-compliant behaviour, but may
883 leave you open to loops.</p>
886 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
887 <div class="directive-section"><h2><a name="ProxyPass" id="ProxyPass">ProxyPass</a> <a name="proxypass" id="proxypass">Directive</a></h2>
888 <table class="directive">
889 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps remote servers into the local server URL-space</td></tr>
890 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPass [<var>path</var>] !|<var>url</var> [<var>key=value</var>
891 <var>[key=value</var> ...]] [nocanon] [interpolate]</code></td></tr>
892 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
893 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
894 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
896 <p>This directive allows remote servers to be mapped into the
897 space of the local server; the local server does not act as a
898 proxy in the conventional sense, but appears to be a mirror of the
899 remote server. The local server is often called a <dfn>reverse
900 proxy</dfn> or <dfn>gateway</dfn>. The <var>path</var> is the name of
901 a local virtual path; <var>url</var> is a partial URL for the
902 remote server and cannot include a query string.</p>
904 <div class="warning">The <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive should
905 usually be set <strong>off</strong> when using
906 <code class="directive">ProxyPass</code>.</div>
908 <p>Suppose the local server has address <code>http://example.com/</code>;
911 <div class="example"><p><code>
912 <Location /mirror/foo/><br />
913 <span class="indent">
914 ProxyPass http://backend.example.com/<br />
916 </Location><br />
919 <p>will cause a local request for
920 <code>http://example.com/mirror/foo/bar</code> to be internally converted
921 into a proxy request to <code>http://backend.example.com/bar</code>.</p>
923 <p>The following alternative syntax is possible, however carries a
924 performance penalty when present in large numbers:</p>
926 <div class="example"><p><code>
927 ProxyPass /mirror/foo/ http://backend.example.com/
930 <div class="warning">
931 <p>If the first argument ends with a trailing <strong>/</strong>, the second
932 argument should also end with a trailing <strong>/</strong> and vice
933 versa. Otherwise the resulting requests to the backend may miss some
934 needed slashes and do not deliver the expected results.
938 <p>The <code>!</code> directive is useful in situations where you don't want
939 to reverse-proxy a subdirectory, <em>e.g.</em></p>
941 <div class="example"><p><code>
942 <Location /mirror/foo/><br />
943 <span class="indent">
944 ProxyPass http://backend.example.com/<br />
946 </Location><br />
947 <Location /mirror/foo/i><br />
948 <span class="indent">
951 </Location><br />
954 <div class="example"><p><code>
955 ProxyPass /mirror/foo/i !<br />
956 ProxyPass /mirror/foo http://backend.example.com
959 <p>will proxy all requests to <code>/mirror/foo</code> to
960 <code>backend.example.com</code> <em>except</em> requests made to
961 <code>/mirror/foo/i</code>.</p>
963 <div class="warning"><h3>Ordering ProxyPass Directives</h3>
964 <p>The configured <code class="directive"><a href="#proxypass">ProxyPass</a></code>
965 and <code class="directive"><a href="#proxypassmatch">ProxyPassMatch</a></code>
966 rules are checked in the order of configuration. The first rule that
967 matches wins. So usually you should sort conflicting
968 <code class="directive"><a href="#proxypass">ProxyPass</a></code> rules starting with the
969 longest URLs first. Otherwise later rules for longer URLS will be hidden
970 by any earlier rule which uses a leading substring of the URL. Note that
971 there is some relation with worker sharing. In contrast, only one
972 <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive can be placed
973 in a <code class="directive"><a href="../mod/core.html#location">Location</a></code> block, and the most
974 specific location will take precedence.</p>
976 <p>For the same reasons exclusions must come <em>before</em> the
977 general <code class="directive">ProxyPass</code> directives.</p>
981 <p>In Apache HTTP Server 2.1 and later, mod_proxy supports pooled
982 connections to a backend server. Connections created on demand
983 can be retained in a pool for future use. Limits on the pool size
984 and other settings can be coded on
985 the <code class="directive">ProxyPass</code> directive
986 using <code>key=value</code> parameters, described in the table
989 <p>By default, mod_proxy will allow and retain the maximum number of
990 connections that could be used simultaneously by that web server child
991 process. Use the <code>max</code> parameter to reduce the number from
992 the default. Use the <code>ttl</code> parameter to set an optional
993 time to live; connections which have been unused for at least
994 <code>ttl</code> seconds will be closed. <code>ttl</code> can be used
995 to avoid using a connection which is subject to closing because of the
996 backend server's keep-alive timeout.</p>
998 <p>The pool of connections is maintained per web server child
999 process, and <code>max</code> and other settings are not coordinated
1000 among all child processes, except when only one child process is allowed
1001 by configuration or MPM design.</p>
1003 <div class="example"><h3>Example</h3><p><code>
1004 ProxyPass /example http://backend.example.com max=20 ttl=120 retry=300
1007 <table class="bordered"><tr><th>BalancerMember parameters</th></tr></table>
1009 <tr><th>Parameter</th>
1011 <th>Description</th></tr>
1014 <td>Minimum number of connection pool entries, unrelated to the
1015 actual number of connections. This only needs to be modified from the
1016 default for special circumstances where heap memory associated with the
1017 backend connections should be preallocated or retained.</td></tr>
1020 <td>Maximum number of connections that will be allowed to the
1021 backend server. The default for this limit is the number of threads
1022 per process in the active MPM. In the Prefork MPM, this is always 1,
1023 while with other MPMs it is controlled by the
1024 <code class="directive">ThreadsPerChild</code> directive.</td></tr>
1027 <td>Retained connection pool entries above this limit are freed
1028 during certain operations if they have been unused for longer than
1029 the time to live, controlled by the <code>ttl</code> parameter. If
1030 the connection pool entry has an associated connection, it will be
1031 closed. This only needs to be modified from the default for special
1032 circumstances where connection pool entries and any associated
1033 connections which have exceeded the time to live need to be freed or
1034 closed more aggressively.</td></tr>
1035 <tr><td>acquire</td>
1037 <td>If set this will be the maximum time to wait for a free
1038 connection in the connection pool, in milliseconds. If there are no free
1039 connections in the pool the Apache httpd will return <code>SERVER_BUSY</code>
1040 status to the client.
1042 <tr><td>connectiontimeout</td>
1044 <td>Connect timeout in seconds.
1045 The number of seconds Apache httpd waits for the creation of a connection to
1046 the backend to complete. By adding a postfix of ms the timeout can be
1047 also set in milliseconds.
1049 <tr><td>disablereuse</td>
1051 <td>This parameter should be used when you want to force mod_proxy
1052 to immediately close a connection to the backend after being used, and
1053 thus, disable its persistent connection and pool for that backend.
1054 This helps in various situations where a firewall between Apache
1056 the backend server (regardless of protocol) tends to silently
1057 drop connections or when backends themselves may be under round-
1058 robin DNS. To disable connection pooling reuse,
1059 set this property value to <code>On</code>.
1061 <tr><td>flushpackets</td>
1063 <td>Determines whether the proxy module will auto-flush the output
1064 brigade after each "chunk" of data. 'off' means that it will flush
1065 only when needed, 'on' means after each chunk is sent and
1066 'auto' means poll/wait for a period of time and flush if
1067 no input has been received for 'flushwait' milliseconds.
1068 Currently this is in effect only for AJP.
1070 <tr><td>flushwait</td>
1072 <td>The time to wait for additional input, in milliseconds, before
1073 flushing the output brigade if 'flushpackets' is 'auto'.
1075 <tr><td>iobuffersize</td>
1077 <td>Adjusts the size of the internal scratchpad IO buffer. This allows you
1078 to override the <code class="directive">ProxyIOBufferSize</code> for a specific worker.
1079 This must be at least 512 or set to 0 for the system default of 8192.
1081 <tr><td>keepalive</td>
1083 <td><p>This parameter should be used when you have a firewall between your
1084 Apache httpd and the backend server, who tend to drop inactive connections.
1085 This flag will tell the Operating System to send <code>KEEP_ALIVE</code>
1086 messages on inactive connections and thus prevent the firewall to drop the connection.
1087 To enable keepalive set this property value to <code>On</code>. </p>
1088 <p>The frequency of initial and subsequent TCP keepalive probes
1089 depends on global OS settings, and may be as high as 2 hours. To be useful,
1090 the frequency configured in the OS must be smaller than the threshold used
1091 by the firewall.</p>
1095 <td>Sets the load balancer cluster set that the worker is a member
1096 of. The load balancer will try all members of a lower numbered
1097 lbset before trying higher numbered ones.
1101 <td>Ping property tells the webserver to "test" the connection to
1102 the backend before forwarding the request. For AJP, it causes
1103 <code class="module"><a href="../mod/mod_proxy_ajp.html">mod_proxy_ajp</a></code>to send a <code>CPING</code>
1104 request on the ajp13 connection (implemented on Tomcat 3.3.2+, 4.1.28+
1105 and 5.0.13+). For HTTP, it causes <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code>
1106 to send a <code>100-Continue</code> to the backend (only valid for
1107 HTTP/1.1 - for non HTTP/1.1 backends, this property has no
1108 effect). In both cases the parameter is the delay in seconds to wait
1110 This feature has been added to avoid problems with hung and
1112 This will increase the network traffic during the normal operation
1113 which could be an issue, but it will lower the
1114 traffic in case some of the cluster nodes are down or busy.
1115 By adding a postfix of ms the delay can be also set in
1118 <tr><td>receivebuffersize</td>
1120 <td>Adjusts the size of the explicit (TCP/IP) network buffer size for
1121 proxied connections. This allows you to override the
1122 <code class="directive">ProxyReceiveBufferSize</code> for a specific worker.
1123 This must be at least 512 or set to 0 for the system default.
1125 <tr><td>redirect</td>
1127 <td>Redirection Route of the worker. This value is usually
1128 set dynamically to enable safe removal of the node from
1129 the cluster. If set all requests without session id will be
1130 redirected to the BalancerMember that has route parametar
1131 equal as this value.
1135 <td>Connection pool worker retry timeout in seconds.
1136 If the connection pool worker to the backend server is in the error state,
1137 Apache httpd will not forward any requests to that server until the timeout
1138 expires. This enables to shut down the backend server for maintenance,
1139 and bring it back online later. A value of 0 means always retry workers
1140 in an error state with no timeout.
1144 <td>Route of the worker when used inside load balancer.
1145 The route is a value appended to session id.
1149 <td>Single letter value defining the initial status of
1152 <tr><td>D: Worker is disabled and will not accept any requests.</td></tr>
1153 <tr><td>S: Worker is administratively stopped.</td></tr>
1154 <tr><td>I: Worker is in ignore-errors mode, and will always be considered available.</td></tr>
1155 <tr><td>H: Worker is in hot-standby mode and will only be used if no other
1156 viable workers are available.</td></tr>
1157 <tr><td>E: Worker is in an error state.</td></tr>
1158 <tr><td>N: Worker is in drain mode, and will only accept existing sticky sessions
1159 destined for itself and ignore all other requests.</td></tr>
1161 can be set (which is the default) by prepending with '+' or
1162 cleared by prepending with '-'.
1163 Thus, a setting of 'S-E' sets this worker to Stopped and
1164 clears the in-error flag.
1166 <tr><td>timeout</td>
1167 <td><code class="directive"><a href="#proxytimeout">ProxyTimeout</a></code></td>
1168 <td>Connection timeout in seconds.
1169 The number of seconds Apache httpd waits for data sent by / to the backend.
1173 <td>Time to live for inactive connections and associated connection
1174 pool entries, in seconds. Once reaching this limit, a
1175 connection will not be used again; it will be closed at some
1181 <p>If the Proxy directive scheme starts with the
1182 <code>balancer://</code> (eg: <code>balancer://cluster/</code>,
1183 any path information is ignored) then a virtual worker that does not really
1184 communicate with the backend server will be created. Instead it is responsible
1185 for the management of several "real" workers. In that case the special set of
1186 parameters can be add to this virtual worker. See <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code>
1187 for more information about how the balancer works.
1189 <table class="bordered"><tr><th>Balancer parameters</th></tr></table>
1191 <tr><th>Parameter</th>
1193 <th>Description</th></tr>
1194 <tr><td>lbmethod</td>
1196 <td>Balancer load-balance method. Select the load-balancing scheduler
1197 method to use. Either <code>byrequests</code>, to perform weighted
1198 request counting, <code>bytraffic</code>, to perform weighted
1199 traffic byte count balancing, or <code>bybusyness</code>, to perform
1200 pending request balancing. Default is <code>byrequests</code>.
1202 <tr><td>maxattempts</td>
1203 <td>One less than the number of workers, or 1 with a single worker.</td>
1204 <td>Maximum number of failover attempts before giving up.
1206 <tr><td>nofailover</td>
1208 <td>If set to <code>On</code> the session will break if the worker is in
1209 error state or disabled. Set this value to On if backend servers do not
1210 support session replication.
1212 <tr><td>stickysession</td>
1214 <td>Balancer sticky session name. The value is usually set to something
1215 like <code>JSESSIONID</code> or <code>PHPSESSIONID</code>,
1216 and it depends on the backend application server that support sessions.
1217 If the backend application server uses different name for cookies
1218 and url encoded id (like servlet containers) use | to to separate them.
1219 The first part is for the cookie the second for the path.
1221 <tr><td>scolonpathdelim</td>
1223 <td>If set to <code>On</code> the semi-colon character ';' will be
1224 used as an additional sticky session path deliminator/separator. This
1225 is mainly used to emulate mod_jk's behavior when dealing with paths such
1226 as <code>JSESSIONID=6736bcf34;foo=aabfa</code>
1228 <tr><td>timeout</td>
1230 <td>Balancer timeout in seconds. If set this will be the maximum time
1231 to wait for a free worker. Default is not to wait.
1233 <tr><td>failonstatus</td>
1235 <td>A single or comma-separated list of HTTP status codes. If set this will
1236 force the worker into error state when the backend returns any status code
1237 in the list. Worker recovery behaves the same as other worker errors.
1240 <td><auto></td>
1241 <td>The protective nonce used in the <code>balancer-manager</code> application page.
1242 The default is to use an automatically determined UUID-based
1243 nonce, to provide for further protection for the page. If set,
1244 then the nonce is set to that value. A setting of <code>None</code>
1245 disables all nonce checking.
1246 <div class="note"><h3>Note</h3>
1247 <p>In addition to the nonce, the <code>balancer-manager</code> page
1248 should be protected via an ACL.</p>
1253 <td>Number of additional BalancerMembers to allow to be added
1254 to this balancer in addition to those defined at configuration.
1258 <p>A sample balancer setup</p>
1259 <div class="example"><p><code>
1260 ProxyPass /special-area http://special.example.com smax=5 max=10<br />
1261 ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On<br />
1262 <Proxy balancer://mycluster><br />
1263 <span class="indent">
1264 BalancerMember ajp://1.2.3.4:8009<br />
1265 BalancerMember ajp://1.2.3.5:8009 loadfactor=20<br />
1266 # Less powerful server, don't send as many requests there,<br />
1267 BalancerMember ajp://1.2.3.6:8009 loadfactor=5<br />
1272 <p>Setting up a hot-standby, that will only be used if no other
1273 members are available</p>
1274 <div class="example"><p><code>
1275 ProxyPass / balancer://hotcluster/ <br />
1276 <Proxy balancer://hotcluster><br />
1277 <span class="indent">
1278 BalancerMember ajp://1.2.3.4:8009 loadfactor=1<br />
1279 BalancerMember ajp://1.2.3.5:8009 loadfactor=2<br />
1280 # The below is the hot standby<br />
1281 BalancerMember ajp://1.2.3.6:8009 status=+H<br />
1282 ProxySet lbmethod=bytraffic
1287 <p>Normally, mod_proxy will canonicalise ProxyPassed URLs.
1288 But this may be incompatible with some backends, particularly those
1289 that make use of <var>PATH_INFO</var>. The optional <var>nocanon</var>
1290 keyword suppresses this, and passes the URL path "raw" to the
1291 backend. Note that may affect the security of your backend, as it
1292 removes the normal limited protection against URL-based attacks
1293 provided by the proxy.</p>
1295 <p>The optional <var>interpolate</var> keyword (available in
1296 httpd 2.2.9 and later), in combination with
1297 <code class="directive">ProxyPassInterpolateEnv</code> causes the ProxyPass
1298 to interpolate environment variables, using the syntax
1299 <var>${VARNAME}</var>. Note that many of the standard CGI-derived
1300 environment variables will not exist when this interpolation happens,
1301 so you may still have to resort to <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
1302 for complex rules.</p>
1304 <p>When used inside a <code class="directive"><a href="../mod/core.html#location"><Location></a></code> section, the first argument is omitted and the local
1305 directory is obtained from the <code class="directive"><a href="../mod/core.html#location"><Location></a></code>. The same will occur inside a
1306 <code class="directive"><a href="../mod/core.html#locationmatch"><LocationMatch></a></code> section,
1307 however ProxyPass does not interpret the regexp as such, so it is necessary
1308 to use <code class="directive">ProxyPassMatch</code> in this situation instead.</p>
1310 <p>This directive is not supported in <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> or <code class="directive"><a href="../mod/core.html#files"><Files></a></code> sections.</p>
1312 <p>If you require a more flexible reverse-proxy configuration, see the
1313 <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directive with the
1314 <code>[P]</code> flag.</p>
1318 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1319 <div class="directive-section"><h2><a name="ProxyPassInterpolateEnv" id="ProxyPassInterpolateEnv">ProxyPassInterpolateEnv</a> <a name="proxypassinterpolateenv" id="proxypassinterpolateenv">Directive</a></h2>
1320 <table class="directive">
1321 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable Environment Variable interpolation in Reverse Proxy configurations</td></tr>
1322 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassInterpolateEnv On|Off</code></td></tr>
1323 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyPassInterpolateEnv Off</code></td></tr>
1324 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1325 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1326 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1327 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in httpd 2.2.9 and later</td></tr>
1329 <p>This directive, together with the <var>interpolate</var> argument to
1330 <code class="directive">ProxyPass</code>, <code class="directive">ProxyPassReverse</code>,
1331 <code class="directive">ProxyPassReverseCookieDomain</code> and
1332 <code class="directive">ProxyPassReverseCookiePath</code>
1333 enables reverse proxies to be dynamically
1334 configured using environment variables, which may be set by
1335 another module such as <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>.
1336 It affects the <code class="directive">ProxyPass</code>,
1337 <code class="directive">ProxyPassReverse</code>,
1338 <code class="directive">ProxyPassReverseCookieDomain</code>, and
1339 <code class="directive">ProxyPassReverseCookiePath</code> directives,
1340 and causes them to substitute the value of an environment
1341 variable <code>varname</code> for the string <code>${varname}</code>
1342 in configuration directives (if the <var>interpolate</var> option is set).</p>
1343 <p>Keep this turned off (for server performance) unless you need it!</p>
1346 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1347 <div class="directive-section"><h2><a name="ProxyPassMatch" id="ProxyPassMatch">ProxyPassMatch</a> <a name="proxypassmatch" id="proxypassmatch">Directive</a></h2>
1348 <table class="directive">
1349 <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>
1350 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassMatch [<var>regex</var>] !|<var>url</var> [<var>key=value</var>
1351 <var>[key=value</var> ...]]</code></td></tr>
1352 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1353 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1354 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1356 <p>This directive is equivalent to <code class="directive"><a href="#proxypass">ProxyPass</a></code>,
1357 but makes use of regular expressions, instead of simple prefix matching. The
1358 supplied regular expression is matched against the <var>url</var>, and if it
1359 matches, the server will substitute any parenthesized matches into the given
1360 string and use it as a new <var>url</var>.</p>
1362 <p>Suppose the local server has address <code>http://example.com/</code>;
1365 <div class="example"><p><code>
1366 ProxyPassMatch ^(/.*\.gif)$ http://backend.example.com$1
1369 <p>will cause a local request for
1370 <code>http://example.com/foo/bar.gif</code> to be internally converted
1371 into a proxy request to <code>http://backend.example.com/foo/bar.gif</code>.</p>
1372 <div class="note"><h3>Note</h3>
1373 <p>The URL argument must be parsable as a URL <em>before</em> regexp
1374 substitutions (as well as after). This limits the matches you can use.
1375 For instance, if we had used</p>
1376 <div class="example"><p><code>
1377 ProxyPassMatch ^(/.*\.gif)$ http://backend.example.com:8000$1
1379 <p>in our previous example, it would fail with a syntax error
1380 at server startup. This is a bug (PR 46665 in the ASF bugzilla),
1381 and the workaround is to reformulate the match:</p>
1382 <div class="example"><p><code>
1383 ProxyPassMatch ^/(.*\.gif)$ http://backend.example.com:8000/$1
1386 <p>The <code>!</code> directive is useful in situations where you don't want
1387 to reverse-proxy a subdirectory.</p>
1389 <p>When used inside a <code class="directive"><a href="../mod/core.html#locationmatch"><LocationMatch></a></code> section, the first argument is omitted and the
1390 regexp is obtained from the <code class="directive"><a href="../mod/core.html#locationmatch"><LocationMatch></a></code>.</p>
1392 <p>If you require a more flexible reverse-proxy configuration, see the
1393 <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directive with the
1394 <code>[P]</code> flag.</p>
1396 <div class="warning">
1397 <h3>Security Warning</h3>
1398 <p>Take care when constructing the target URL of the rule, considering
1399 the security impact from allowing the client influence over the set of
1400 URLs to which your server will act as a proxy. Ensure that the scheme
1401 and hostname part of the URL is either fixed, or does not allow the
1402 client undue influence.</p>
1406 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1407 <div class="directive-section"><h2><a name="ProxyPassReverse" id="ProxyPassReverse">ProxyPassReverse</a> <a name="proxypassreverse" id="proxypassreverse">Directive</a></h2>
1408 <table class="directive">
1409 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the URL in HTTP response headers sent from a reverse
1410 proxied server</td></tr>
1411 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverse [<var>path</var>] <var>url</var>
1412 [<var>interpolate</var>]</code></td></tr>
1413 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1414 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1415 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1417 <p>This directive lets Apache httpd adjust the URL in the <code>Location</code>,
1418 <code>Content-Location</code> and <code>URI</code> headers on HTTP
1419 redirect responses. This is essential when Apache httpd is used as a
1420 reverse proxy (or gateway) to avoid by-passing the reverse proxy
1421 because of HTTP redirects on the backend servers which stay behind
1422 the reverse proxy.</p>
1424 <p>Only the HTTP response headers specifically mentioned above
1425 will be rewritten. Apache httpd will not rewrite other response
1426 headers, nor will it rewrite URL references inside HTML pages.
1427 This means that if the proxied content contains absolute URL
1428 references, they will by-pass the proxy. A third-party module
1429 that will look inside the HTML and rewrite URL references is Nick
1430 Kew's <a href="http://apache.webthing.com/mod_proxy_html/">mod_proxy_html</a>.</p>
1432 <p><var>path</var> is the name of a local virtual path. <var>url</var> is a
1433 partial URL for the remote server - the same way they are used for the
1434 <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
1436 <p>For example, suppose the local server has address
1437 <code>http://example.com/</code>; then</p>
1439 <div class="example"><p><code>
1440 ProxyPass /mirror/foo/ http://backend.example.com/<br />
1441 ProxyPassReverse /mirror/foo/ http://backend.example.com/<br />
1442 ProxyPassReverseCookieDomain backend.example.com public.example.com<br />
1443 ProxyPassReverseCookiePath / /mirror/foo/
1446 <p>will not only cause a local request for the
1447 <code>http://example.com/mirror/foo/bar</code> to be internally converted
1448 into a proxy request to <code>http://backend.example.com/bar</code>
1449 (the functionality <code>ProxyPass</code> provides here). It also takes care
1450 of redirects the server <code>backend.example.com</code> sends: when
1451 <code>http://backend.example.com/bar</code> is redirected by him to
1452 <code>http://backend.example.com/quux</code> Apache httpd adjusts this to
1453 <code>http://example.com/mirror/foo/quux</code> before forwarding the HTTP
1454 redirect response to the client. Note that the hostname used for
1455 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>
1457 <p>Note that this <code class="directive">ProxyPassReverse</code> directive can
1458 also be used in conjunction with the proxy pass-through feature
1459 (<code>RewriteRule ... [P]</code>) from <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
1460 because it doesn't depend on a corresponding <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
1462 <p>The optional <var>interpolate</var> keyword (available in
1463 httpd 2.2.9 and later), used together with
1464 <code class="directive">ProxyPassInterpolateEnv</code>, enables interpolation
1465 of environment variables specified using the format <var>${VARNAME}</var>.
1468 <p>When used inside a <code class="directive"><a href="../mod/core.html#location"><Location></a></code> section, the first argument is omitted and the local
1469 directory is obtained from the <code class="directive"><a href="../mod/core.html#location"><Location></a></code>. The same occurs inside a <code class="directive"><a href="../mod/core.html#locationmatch"><LocationMatch></a></code> section, but will probably not work as
1470 intended, as ProxyPassReverse will interpret the regexp literally as a
1471 path; if needed in this situation, specify the ProxyPassReverse outside
1472 the section, or in a separate <code class="directive"><a href="../mod/core.html#location"><Location></a></code> section.</p>
1474 <p>This directive is not supported in <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> or <code class="directive"><a href="../mod/core.html#files"><Files></a></code> sections.</p>
1477 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1478 <div class="directive-section"><h2><a name="ProxyPassReverseCookieDomain" id="ProxyPassReverseCookieDomain">ProxyPassReverseCookieDomain</a> <a name="proxypassreversecookiedomain" id="proxypassreversecookiedomain">Directive</a></h2>
1479 <table class="directive">
1480 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the Domain string in Set-Cookie headers from a reverse-
1481 proxied server</td></tr>
1482 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverseCookieDomain <var>internal-domain</var>
1483 <var>public-domain</var> [<var>interpolate</var>]</code></td></tr>
1484 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1485 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1486 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1488 <p>Usage is basically similar to
1489 <code class="directive"><a href="#proxypassreverse">ProxyPassReverse</a></code>, but instead of
1490 rewriting headers that are a URL, this rewrites the <code>domain</code>
1491 string in <code>Set-Cookie</code> headers.</p>
1494 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1495 <div class="directive-section"><h2><a name="ProxyPassReverseCookiePath" id="ProxyPassReverseCookiePath">ProxyPassReverseCookiePath</a> <a name="proxypassreversecookiepath" id="proxypassreversecookiepath">Directive</a></h2>
1496 <table class="directive">
1497 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the Path string in Set-Cookie headers from a reverse-
1498 proxied server</td></tr>
1499 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverseCookiePath <var>internal-path</var>
1500 <var>public-path</var> [<var>interpolate</var>]</code></td></tr>
1501 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1502 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1503 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1506 Useful in conjunction with
1507 <code class="directive"><a href="#proxypassreverse">ProxyPassReverse</a></code>
1508 in situations where backend URL paths are mapped to public paths on the
1509 reverse proxy. This directive rewrites the <code>path</code> string in
1510 <code>Set-Cookie</code> headers. If the beginning of the cookie path matches
1511 <var>internal-path</var>, the cookie path will be replaced with
1512 <var>public-path</var>.
1514 In the example given with
1515 <code class="directive"><a href="#proxypassreverse">ProxyPassReverse</a></code>, the directive:
1517 <div class="example"><p><code>
1518 ProxyPassReverseCookiePath / /mirror/foo/
1521 will rewrite a cookie with backend path <code>/</code> (or
1522 <code>/example</code> or, in fact, anything) to <code>/mirror/foo/</code>.
1526 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1527 <div class="directive-section"><h2><a name="ProxyPreserveHost" id="ProxyPreserveHost">ProxyPreserveHost</a> <a name="proxypreservehost" id="proxypreservehost">Directive</a></h2>
1528 <table class="directive">
1529 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use incoming Host HTTP request header for proxy
1531 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPreserveHost On|Off</code></td></tr>
1532 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyPreserveHost Off</code></td></tr>
1533 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1534 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1535 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1536 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache HTTP Server 2.0.31 and later. Usable in directory
1537 context in 2.3.3 and later.</td></tr>
1539 <p>When enabled, this option will pass the Host: line from the incoming
1540 request to the proxied host, instead of the hostname specified in the
1541 <code class="directive">ProxyPass</code> line.</p>
1543 <p>This option should normally be turned <code>Off</code>. It is mostly
1544 useful in special configurations like proxied mass name-based virtual
1545 hosting, where the original Host header needs to be evaluated by the
1549 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1550 <div class="directive-section"><h2><a name="ProxyReceiveBufferSize" id="ProxyReceiveBufferSize">ProxyReceiveBufferSize</a> <a name="proxyreceivebuffersize" id="proxyreceivebuffersize">Directive</a></h2>
1551 <table class="directive">
1552 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Network buffer size for proxied HTTP and FTP
1553 connections</td></tr>
1554 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyReceiveBufferSize <var>bytes</var></code></td></tr>
1555 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyReceiveBufferSize 0</code></td></tr>
1556 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1557 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1558 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1560 <p>The <code class="directive">ProxyReceiveBufferSize</code> directive specifies an
1561 explicit (TCP/IP) network buffer size for proxied HTTP and FTP connections,
1562 for increased throughput. It has to be greater than <code>512</code> or set
1563 to <code>0</code> to indicate that the system's default buffer size should
1566 <div class="example"><h3>Example</h3><p><code>
1567 ProxyReceiveBufferSize 2048
1571 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1572 <div class="directive-section"><h2><a name="ProxyRemote" id="ProxyRemote">ProxyRemote</a> <a name="proxyremote" id="proxyremote">Directive</a></h2>
1573 <table class="directive">
1574 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Remote proxy used to handle certain requests</td></tr>
1575 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRemote <var>match</var> <var>remote-server</var></code></td></tr>
1576 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1577 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1578 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1580 <p>This defines remote proxies to this proxy. <var>match</var> is either the
1581 name of a URL-scheme that the remote server supports, or a partial URL
1582 for which the remote server should be used, or <code>*</code> to indicate
1583 the server should be contacted for all requests. <var>remote-server</var> is
1584 a partial URL for the remote server. Syntax:</p>
1586 <div class="example"><p><code>
1587 <dfn>remote-server</dfn> =
1588 <var>scheme</var>://<var>hostname</var>[:<var>port</var>]
1591 <p><var>scheme</var> is effectively the protocol that should be used to
1592 communicate with the remote server; only <code>http</code> and <code>https</code>
1593 are supported by this module. When using <code>https</code>, the requests
1594 are forwarded through the remote proxy using the HTTP CONNECT method.</p>
1596 <div class="example"><h3>Example</h3><p><code>
1597 ProxyRemote http://goodguys.example.com/ http://mirrorguys.example.com:8000<br />
1598 ProxyRemote * http://cleverproxy.localdomain<br />
1599 ProxyRemote ftp http://ftpproxy.mydomain:8080
1602 <p>In the last example, the proxy will forward FTP requests, encapsulated
1603 as yet another HTTP proxy request, to another proxy which can handle
1606 <p>This option also supports reverse proxy configuration - a backend
1607 webserver can be embedded within a virtualhost URL space even if that
1608 server is hidden by another forward proxy.</p>
1611 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1612 <div class="directive-section"><h2><a name="ProxyRemoteMatch" id="ProxyRemoteMatch">ProxyRemoteMatch</a> <a name="proxyremotematch" id="proxyremotematch">Directive</a></h2>
1613 <table class="directive">
1614 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Remote proxy used to handle requests matched by regular
1615 expressions</td></tr>
1616 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRemoteMatch <var>regex</var> <var>remote-server</var></code></td></tr>
1617 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1618 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1619 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1621 <p>The <code class="directive">ProxyRemoteMatch</code> is identical to the
1622 <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> directive, except the
1623 first argument is a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
1624 match against the requested URL.</p>
1627 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1628 <div class="directive-section"><h2><a name="ProxyRequests" id="ProxyRequests">ProxyRequests</a> <a name="proxyrequests" id="proxyrequests">Directive</a></h2>
1629 <table class="directive">
1630 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables forward (standard) proxy requests</td></tr>
1631 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRequests On|Off</code></td></tr>
1632 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyRequests Off</code></td></tr>
1633 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1634 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1635 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1637 <p>This allows or prevents Apache httpd from functioning as a forward proxy
1638 server. (Setting ProxyRequests to <code>Off</code> does not disable use of
1639 the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.)</p>
1641 <p>In a typical reverse proxy or gateway configuration, this
1642 option should be set to
1643 <code>Off</code>.</p>
1645 <p>In order to get the functionality of proxying HTTP or FTP sites, you
1646 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>
1647 (or both) present in the server.</p>
1649 <div class="warning"><h3>Warning</h3>
1650 <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
1651 both to your network and to the Internet at large.</p>
1656 <li><a href="#forwardreverse">Forward and Reverse Proxies/Gateways</a></li>
1659 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1660 <div class="directive-section"><h2><a name="ProxySet" id="ProxySet">ProxySet</a> <a name="proxyset" id="proxyset">Directive</a></h2>
1661 <table class="directive">
1662 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Set various Proxy balancer or member parameters</td></tr>
1663 <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>
1664 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
1665 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1666 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1667 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>ProxySet is only available in Apache HTTP Server 2.2
1668 and later.</td></tr>
1670 <p>This directive is used as an alternate method of setting any of the
1671 parameters available to Proxy balancers and workers normally done via the
1672 <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive. If used
1673 within a <code><Proxy <var>balancer url|worker url</var>></code>
1674 container directive, the <var>url</var> argument is not required. As a side
1675 effect the respective balancer or worker gets created. This can be useful
1676 when doing reverse proxying via a
1677 <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> instead of a
1678 <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
1680 <div class="example"><p><code>
1681 <Proxy balancer://hotcluster><br />
1682 <span class="indent">
1683 BalancerMember http://www2.example.com:8080 loadfactor=1<br />
1684 BalancerMember http://www3.example.com:8080 loadfactor=2<br />
1685 ProxySet lbmethod=bytraffic<br />
1690 <div class="example"><p><code>
1691 <Proxy http://backend><br />
1692 <span class="indent">
1693 ProxySet keepalive=On<br />
1698 <div class="example"><p><code>
1699 ProxySet balancer://foo lbmethod=bytraffic timeout=15
1702 <div class="example"><p><code>
1703 ProxySet ajp://backend:7001 timeout=15
1706 <div class="warning"><h3>Warning</h3>
1707 <p>Keep in mind that the same parameter key can have a different meaning
1708 depending whether it is applied to a balancer or a worker as shown by the two
1709 examples above regarding timeout.</p>
1714 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1715 <div class="directive-section"><h2><a name="ProxySourceAddress" id="ProxySourceAddress">ProxySourceAddress</a> <a name="proxysourceaddress" id="proxysourceaddress">Directive</a></h2>
1716 <table class="directive">
1717 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Set local IP address for outgoing proxy connections</td></tr>
1718 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxySourceAddress <var>address</var></code></td></tr>
1719 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1720 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1721 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1722 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.3.9 and later</td></tr>
1724 <p>This directive allows to set a specific local address to bind to when connecting
1725 to a backend server.</p>
1728 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1729 <div class="directive-section"><h2><a name="ProxyStatus" id="ProxyStatus">ProxyStatus</a> <a name="proxystatus" id="proxystatus">Directive</a></h2>
1730 <table class="directive">
1731 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Show Proxy LoadBalancer status in mod_status</td></tr>
1732 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyStatus Off|On|Full</code></td></tr>
1733 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyStatus Off</code></td></tr>
1734 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1735 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1736 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1737 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.2 and later</td></tr>
1739 <p>This directive determines whether or not proxy
1740 loadbalancer status data is displayed via the <code class="module"><a href="../mod/mod_status.html">mod_status</a></code>
1741 server-status page.</p>
1742 <div class="note"><h3>Note</h3>
1743 <p><strong>Full</strong> is synonymous with <strong>On</strong></p>
1748 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1749 <div class="directive-section"><h2><a name="ProxyTimeout" id="ProxyTimeout">ProxyTimeout</a> <a name="proxytimeout" id="proxytimeout">Directive</a></h2>
1750 <table class="directive">
1751 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Network timeout for proxied requests</td></tr>
1752 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyTimeout <var>seconds</var></code></td></tr>
1753 <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>
1754 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1755 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1756 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1757 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache HTTP Server 2.0.31 and later</td></tr>
1759 <p>This directive allows a user to specifiy a timeout on proxy requests.
1760 This is useful when you have a slow/buggy appserver which hangs, and you
1761 would rather just return a timeout and fail gracefully instead of waiting
1762 however long it takes the server to return.</p>
1765 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1766 <div class="directive-section"><h2><a name="ProxyVia" id="ProxyVia">ProxyVia</a> <a name="proxyvia" id="proxyvia">Directive</a></h2>
1767 <table class="directive">
1768 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Information provided in the <code>Via</code> HTTP response
1769 header for proxied requests</td></tr>
1770 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyVia On|Off|Full|Block</code></td></tr>
1771 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyVia Off</code></td></tr>
1772 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1773 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1774 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1776 <p>This directive controls the use of the <code>Via:</code> HTTP
1777 header by the proxy. Its intended use is to control the flow of
1778 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
1779 14.45 for an explanation of <code>Via:</code> header lines.</p>
1782 <li>If set to <code>Off</code>, which is the default, no special processing
1783 is performed. If a request or reply contains a <code>Via:</code> header,
1784 it is passed through unchanged.</li>
1786 <li>If set to <code>On</code>, each request and reply will get a
1787 <code>Via:</code> header line added for the current host.</li>
1789 <li>If set to <code>Full</code>, each generated <code>Via:</code> header
1790 line will additionally have the Apache httpd server version shown as a
1791 <code>Via:</code> comment field.</li>
1793 <li>If set to <code>Block</code>, every proxy request will have all its
1794 <code>Via:</code> header lines removed. No new <code>Via:</code> header will
1800 <div class="bottomlang">
1801 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy.html" title="English"> en </a> |
1802 <a href="../fr/mod/mod_proxy.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
1803 <a href="../ja/mod/mod_proxy.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
1804 </div><div id="footer">
1805 <p class="apache">Copyright 2011 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>
1806 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>