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.3</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.3</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="../ja/mod/mod_proxy.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
27 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>HTTP/1.1 proxy/gateway server</td></tr>
28 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
29 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>proxy_module</td></tr>
30 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_proxy.c</td></tr></table>
33 <div class="warning"><h3>Warning</h3>
34 <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
35 network and to the Internet at large.</p>
38 <p>This module implements a proxy/gateway for Apache. It implements
39 proxying capability for <code>AJP13</code> (Apache JServe Protocol
40 version 1.3), <code>FTP</code>, <code>CONNECT</code> (for SSL),
41 <code>HTTP/0.9</code>, <code>HTTP/1.0</code>, and <code>HTTP/1.1</code>.
42 The module can be configured to connect to other proxy modules for these
43 and other protocols.</p>
45 <p>Apache's proxy features are divided into several modules in
46 addition to <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>:
47 <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code>, <code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code>,
48 <code class="module"><a href="../mod/mod_proxy_ajp.html">mod_proxy_ajp</a></code>, <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code>,
49 and <code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code>. Thus, if you want to use
50 one or more of the particular proxy functions, load
51 <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> <em>and</em> the appropriate module(s)
52 into the server (either statically at compile-time or dynamically
53 via the <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>
56 <p>In addition, extended features are provided by other modules.
57 Caching is provided by <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> and related
58 modules. The ability to contact remote servers using the SSL/TLS
59 protocol is provided by the <code>SSLProxy*</code> directives of
60 <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>. These additional modules will need
61 to be loaded and configured to take advantage of these features.</p>
63 <div id="quickview"><h3 class="directives">Directives</h3>
65 <li><img alt="" src="../images/down.gif" /> <a href="#allowconnect">AllowCONNECT</a></li>
66 <li><img alt="" src="../images/down.gif" /> <a href="#balancermember">BalancerMember</a></li>
67 <li><img alt="" src="../images/down.gif" /> <a href="#noproxy">NoProxy</a></li>
68 <li><img alt="" src="../images/down.gif" /> <a href="#proxy"><Proxy></a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#proxybadheader">ProxyBadHeader</a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#proxyblock">ProxyBlock</a></li>
71 <li><img alt="" src="../images/down.gif" /> <a href="#proxydomain">ProxyDomain</a></li>
72 <li><img alt="" src="../images/down.gif" /> <a href="#proxyerroroverride">ProxyErrorOverride</a></li>
73 <li><img alt="" src="../images/down.gif" /> <a href="#proxyftpdircharset">ProxyFtpDirCharset</a></li>
74 <li><img alt="" src="../images/down.gif" /> <a href="#proxyiobuffersize">ProxyIOBufferSize</a></li>
75 <li><img alt="" src="../images/down.gif" /> <a href="#proxymatch"><ProxyMatch></a></li>
76 <li><img alt="" src="../images/down.gif" /> <a href="#proxymaxforwards">ProxyMaxForwards</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#proxypass">ProxyPass</a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassinterpolateenv">ProxyPassInterpolateEnv</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassmatch">ProxyPassMatch</a></li>
80 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassreverse">ProxyPassReverse</a></li>
81 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassreversecookiedomain">ProxyPassReverseCookieDomain</a></li>
82 <li><img alt="" src="../images/down.gif" /> <a href="#proxypassreversecookiepath">ProxyPassReverseCookiePath</a></li>
83 <li><img alt="" src="../images/down.gif" /> <a href="#proxypreservehost">ProxyPreserveHost</a></li>
84 <li><img alt="" src="../images/down.gif" /> <a href="#proxyreceivebuffersize">ProxyReceiveBufferSize</a></li>
85 <li><img alt="" src="../images/down.gif" /> <a href="#proxyremote">ProxyRemote</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#proxyremotematch">ProxyRemoteMatch</a></li>
87 <li><img alt="" src="../images/down.gif" /> <a href="#proxyrequests">ProxyRequests</a></li>
88 <li><img alt="" src="../images/down.gif" /> <a href="#proxyset">ProxySet</a></li>
89 <li><img alt="" src="../images/down.gif" /> <a href="#proxystatus">ProxyStatus</a></li>
90 <li><img alt="" src="../images/down.gif" /> <a href="#proxytimeout">ProxyTimeout</a></li>
91 <li><img alt="" src="../images/down.gif" /> <a href="#proxyvia">ProxyVia</a></li>
95 <li><img alt="" src="../images/down.gif" /> <a href="#forwardreverse">Forward Proxies and Reverse
96 Proxies/Gateways</a></li>
97 <li><img alt="" src="../images/down.gif" /> <a href="#examples">Basic Examples</a></li>
98 <li><img alt="" src="../images/down.gif" /> <a href="#access">Controlling access to your proxy</a></li>
99 <li><img alt="" src="../images/down.gif" /> <a href="#startup">Slow Startup</a></li>
100 <li><img alt="" src="../images/down.gif" /> <a href="#intranet">Intranet Proxy</a></li>
101 <li><img alt="" src="../images/down.gif" /> <a href="#envsettings">Protocol Adjustments</a></li>
102 <li><img alt="" src="../images/down.gif" /> <a href="#request-bodies">Request Bodies</a></li>
103 <li><img alt="" src="../images/down.gif" /> <a href="#x-headers">Reverse Proxy Request Headers</a></li>
104 </ul><h3>See also</h3>
106 <li><code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code></li>
107 <li><code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code></li>
108 <li><code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code></li>
109 <li><code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code></li>
110 <li><code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code></li>
111 <li><code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code></li>
113 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
114 <div class="section">
115 <h2><a name="forwardreverse" id="forwardreverse">Forward Proxies and Reverse
116 Proxies/Gateways</a></h2>
117 <p>Apache can be configured in both a <dfn>forward</dfn> and
118 <dfn>reverse</dfn> proxy (also known as <dfn>gateway</dfn>) mode.</p>
120 <p>An ordinary <dfn>forward proxy</dfn> is an intermediate
121 server that sits between the client and the <em>origin
122 server</em>. In order to get content from the origin server,
123 the client sends a request to the proxy naming the origin server
124 as the target and the proxy then requests the content from the
125 origin server and returns it to the client. The client must be
126 specially configured to use the forward proxy to access other
129 <p>A typical usage of a forward proxy is to provide Internet
130 access to internal clients that are otherwise restricted by a
131 firewall. The forward proxy can also use caching (as provided
132 by <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>) to reduce network usage.</p>
134 <p>The forward proxy is activated using the <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive. Because
135 forward proxies allow clients to access arbitrary sites through
136 your server and to hide their true origin, it is essential that
137 you <a href="#access">secure your server</a> so that only
138 authorized clients can access the proxy before activating a
141 <p>A <dfn>reverse proxy</dfn> (or <dfn>gateway</dfn>), by
142 contrast, appears to the client just like an ordinary web
143 server. No special configuration on the client is necessary.
144 The client makes ordinary requests for content in the name-space
145 of the reverse proxy. The reverse proxy then decides where to
146 send those requests, and returns the content as if it was itself
149 <p>A typical usage of a reverse proxy is to provide Internet
150 users access to a server that is behind a firewall. Reverse
151 proxies can also be used to balance load among several back-end
152 servers, or to provide caching for a slower back-end server.
153 In addition, reverse proxies can be used simply to bring
154 several servers into the same URL space.</p>
156 <p>A reverse proxy is activated using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive or the
157 <code>[P]</code> flag to the <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directive. It is
158 <strong>not</strong> necessary to turn <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> on in order to
159 configure a reverse proxy.</p>
160 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
161 <div class="section">
162 <h2><a name="examples" id="examples">Basic Examples</a></h2>
164 <p>The examples below are only a very basic idea to help you
165 get started. Please read the documentation on the individual
168 <p>In addition, if you wish to have caching enabled, consult
169 the documentation from <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>.</p>
171 <div class="example"><h3>Forward Proxy</h3><p><code>
172 ProxyRequests On<br />
175 <Proxy *><br />
176 <span class="indent">
177 Order deny,allow<br />
179 Allow from internal.example.com<br />
184 <div class="example"><h3>Reverse Proxy</h3><p><code>
185 ProxyRequests Off<br />
187 <Proxy *><br />
188 <span class="indent">
189 Order deny,allow<br />
194 ProxyPass /foo http://foo.example.com/bar<br />
195 ProxyPassReverse /foo http://foo.example.com/bar
197 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
198 <div class="section">
199 <h2><a name="access" id="access">Controlling access to your proxy</a></h2>
200 <p>You can control who can access your proxy via the <code class="directive"><a href="#proxy"><Proxy></a></code> control block as in
201 the following example:</p>
203 <div class="example"><p><code>
204 <Proxy *><br />
205 <span class="indent">
206 Order Deny,Allow<br />
208 Allow from 192.168.0<br />
213 <p>For more information on access control directives, see
214 <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code>.</p>
216 <p>Strictly limiting access is essential if you are using a
217 forward proxy (using the <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive).
218 Otherwise, your server can be used by any client to access
219 arbitrary hosts while hiding his or her true identity. This is
220 dangerous both for your network and for the Internet at large.
221 When using a reverse proxy (using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive with
222 <code>ProxyRequests Off</code>), access control is less
223 critical because clients can only contact the hosts that you
224 have specifically configured.</p>
226 <p><strong>See Also</strong> the <a href="mod_proxy_http.html#env">Proxy-Chain-Auth</a> environment variable.</p>
228 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
229 <div class="section">
230 <h2><a name="startup" id="startup">Slow Startup</a></h2>
231 <p>If you're using the <code class="directive"><a href="#proxyblock">ProxyBlock</a></code> directive, hostnames' IP addresses are looked up
232 and cached during startup for later match test. This may take a few
233 seconds (or more) depending on the speed with which the hostname lookups
235 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
236 <div class="section">
237 <h2><a name="intranet" id="intranet">Intranet Proxy</a></h2>
238 <p>An Apache proxy server situated in an intranet needs to forward
239 external requests through the company's firewall (for this, configure
240 the <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> directive
241 to forward the respective <var>scheme</var> to the firewall proxy).
242 However, when it has to
243 access resources within the intranet, it can bypass the firewall when
244 accessing hosts. The <code class="directive"><a href="#noproxy">NoProxy</a></code>
245 directive is useful for specifying which hosts belong to the intranet and
246 should be accessed directly.</p>
248 <p>Users within an intranet tend to omit the local domain name from their
249 WWW requests, thus requesting "http://somehost/" instead of
250 <code>http://somehost.example.com/</code>. Some commercial proxy servers
251 let them get away with this and simply serve the request, implying a
252 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 can return
253 a redirect response and send the client to the correct, fully qualified,
254 server address. This is the preferred method since the user's bookmark
255 files will then contain fully qualified hosts.</p>
256 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
257 <div class="section">
258 <h2><a name="envsettings" id="envsettings">Protocol Adjustments</a></h2>
259 <p>For circumstances where <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> is sending
260 requests to an origin server that doesn't properly implement
261 keepalives or HTTP/1.1, there are two <a href="../env.html">environment variables</a> that can force the
262 request to use HTTP/1.0 with no keepalive. These are set via the
263 <code class="directive"><a href="../mod/mod_env.html#setenv">SetEnv</a></code> directive.</p>
265 <p>These are the <code>force-proxy-request-1.0</code> and
266 <code>proxy-nokeepalive</code> notes.</p>
268 <div class="example"><p><code>
269 <Location /buggyappserver/><br />
270 <span class="indent">
271 ProxyPass http://buggyappserver:7001/foo/<br />
272 SetEnv force-proxy-request-1.0 1<br />
273 SetEnv proxy-nokeepalive 1<br />
278 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
279 <div class="section">
280 <h2><a name="request-bodies" id="request-bodies">Request Bodies</a></h2>
282 <p>Some request methods such as POST include a request body.
283 The HTTP protocol requires that requests which include a body
284 either use chunked transfer encoding or send a
285 <code>Content-Length</code> request header. When passing these
286 requests on to the origin server, <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code>
287 will always attempt to send the <code>Content-Length</code>. But
288 if the body is large and the original request used chunked
289 encoding, then chunked encoding may also be used in the upstream
290 request. You can control this selection using <a href="../env.html">environment variables</a>. Setting
291 <code>proxy-sendcl</code> ensures maximum compatibility with
292 upstream servers by always sending the
293 <code>Content-Length</code>, while setting
294 <code>proxy-sendchunked</code> minimizes resource usage by using
295 chunked encoding.</p>
297 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
298 <div class="section">
299 <h2><a name="x-headers" id="x-headers">Reverse Proxy Request Headers</a></h2>
301 <p>When acting in a reverse-proxy mode (using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive, for example),
302 <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code> adds several request headers in
303 order to pass information to the origin server. These headers
307 <dt><code>X-Forwarded-For</code></dt>
308 <dd>The IP address of the client.</dd>
309 <dt><code>X-Forwarded-Host</code></dt>
310 <dd>The original host requested by the client in the <code>Host</code>
311 HTTP request header.</dd>
312 <dt><code>X-Forwarded-Server</code></dt>
313 <dd>The hostname of the proxy server.</dd>
316 <p>Be careful when using these headers on the origin server, since
317 they will contain more than one (comma-separated) value if the
318 original request already contained one of these headers. For
319 example, you can use <code>%{X-Forwarded-For}i</code> in the log
320 format string of the origin server to log the original clients IP
321 address, but you may get more than one address if the request
322 passes through several proxies.</p>
324 <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
325 other request headers.</p>
328 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
329 <div class="directive-section"><h2><a name="AllowCONNECT" id="AllowCONNECT">AllowCONNECT</a> <a name="allowconnect" id="allowconnect">Directive</a></h2>
330 <table class="directive">
331 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Ports that are allowed to <code>CONNECT</code> through the
333 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowCONNECT <var>port</var> [<var>port</var>] ...</code></td></tr>
334 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowCONNECT 443 563</code></td></tr>
335 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
336 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
337 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
339 <p>The <code class="directive">AllowCONNECT</code> directive specifies a list
340 of port numbers to which the proxy <code>CONNECT</code> method may
341 connect. Today's browsers use this method when a <code>https</code>
342 connection is requested and proxy tunneling over HTTP is in effect.</p>
344 <p>By default, only the default https port (<code>443</code>) and the
345 default snews port (<code>563</code>) are enabled. Use the
346 <code class="directive">AllowCONNECT</code> directive to override this default and
347 allow connections to the listed ports only.</p>
349 <p>Note that you'll need to have <code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code> present
350 in the server in order to get the support for the <code>CONNECT</code> at
354 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
355 <div class="directive-section"><h2><a name="BalancerMember" id="BalancerMember">BalancerMember</a> <a name="balancermember" id="balancermember">Directive</a></h2>
356 <table class="directive">
357 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Add a member to a load balancing group</td></tr>
358 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>BalancerMember <var>url</var> [<var>key=value [key=value ...]]</var></code></td></tr>
359 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
360 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
361 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
362 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>BalancerMember is only available in Apache 2.2
365 <p>This directive adds a member to a load balancing group. It must be used
366 within a <code><Proxy <var>balancer://</var>...></code> container
367 directive, and can take any of the parameters available to
368 <code class="directive"><a href="#proxypass">ProxyPass</a></code> directives.</p>
369 <p>One additional parameter is available only to <code class="directive"><a href="#balancermember">BalancerMember</a></code> directives:
370 <var>loadfactor</var>. This is the member load factor - a number between 1
371 (default) and 100, which defines the weighted load to be applied to the
372 member in question.</p>
375 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
376 <div class="directive-section"><h2><a name="NoProxy" id="NoProxy">NoProxy</a> <a name="noproxy" id="noproxy">Directive</a></h2>
377 <table class="directive">
378 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hosts, domains, or networks that will be connected to
380 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NoProxy <var>host</var> [<var>host</var>] ...</code></td></tr>
381 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
382 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
383 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
385 <p>This directive is only useful for Apache proxy servers within
386 intranets. The <code class="directive">NoProxy</code> directive specifies a
387 list of subnets, IP addresses, hosts and/or domains, separated by
388 spaces. A request to a host which matches one or more of these is
389 always served directly, without forwarding to the configured
390 <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> proxy server(s).</p>
392 <div class="example"><h3>Example</h3><p><code>
393 ProxyRemote * http://firewall.example.com:81<br />
394 NoProxy .example.com 192.168.112.0/21
397 <p>The <var>host</var> arguments to the <code class="directive">NoProxy</code>
398 directive are one of the following type list:</p>
402 <dt><var><a name="domain" id="domain">Domain</a></var></dt>
404 <p>A <dfn>Domain</dfn> is a partially qualified DNS domain name, preceded
405 by a period. It represents a list of hosts which logically belong to the
406 same DNS domain or zone (<em>i.e.</em>, the suffixes of the hostnames are
407 all ending in <var>Domain</var>).</p>
409 <div class="example"><h3>Examples</h3><p><code>
413 <p>To distinguish <var>Domain</var>s from <var><a href="#hostname">Hostname</a></var>s (both syntactically and semantically; a DNS domain can
414 have a DNS A record, too!), <var>Domain</var>s are always written with a
417 <div class="note"><h3>Note</h3>
418 <p>Domain name comparisons are done without regard to the case, and
419 <var>Domain</var>s are always assumed to be anchored in the root of the
420 DNS tree, therefore two domains <code>.ExAmple.com</code> and
421 <code>.example.com.</code> (note the trailing period) are considered
422 equal. Since a domain comparison does not involve a DNS lookup, it is much
423 more efficient than subnet comparison.</p>
427 <dt><var><a name="subnet" id="subnet">SubNet</a></var></dt>
429 <p>A <dfn>SubNet</dfn> is a partially qualified internet address in
430 numeric (dotted quad) form, optionally followed by a slash and the netmask,
431 specified as the number of significant bits in the <var>SubNet</var>. It is
432 used to represent a subnet of hosts which can be reached over a common
433 network interface. In the absence of the explicit net mask it is assumed
434 that omitted (or zero valued) trailing digits specify the mask. (In this
435 case, the netmask can only be multiples of 8 bits wide.) Examples:</p>
438 <dt><code>192.168</code> or <code>192.168.0.0</code></dt>
439 <dd>the subnet 192.168.0.0 with an implied netmask of 16 valid bits
440 (sometimes used in the netmask form <code>255.255.0.0</code>)</dd>
441 <dt><code>192.168.112.0/21</code></dt>
442 <dd>the subnet <code>192.168.112.0/21</code> with a netmask of 21
443 valid bits (also used in the form <code>255.255.248.0</code>)</dd>
446 <p>As a degenerate case, a <em>SubNet</em> with 32 valid bits is the
447 equivalent to an <var><a href="#ipadr">IPAddr</a></var>, while a <var>SubNet</var> with zero
448 valid bits (<em>e.g.</em>, 0.0.0.0/0) is the same as the constant
449 <var>_Default_</var>, matching any IP address.</p></dd>
452 <dt><var><a name="ipaddr" id="ipaddr">IPAddr</a></var></dt>
454 <p>A <dfn>IPAddr</dfn> represents a fully qualified internet address in
455 numeric (dotted quad) form. Usually, this address represents a host, but
456 there need not necessarily be a DNS domain name connected with the
458 <div class="example"><h3>Example</h3><p><code>
462 <div class="note"><h3>Note</h3>
463 <p>An <var>IPAddr</var> does not need to be resolved by the DNS system, so
464 it can result in more effective apache performance.</p>
468 <dt><var><a name="hostname" id="hostname">Hostname</a></var></dt>
470 <p>A <dfn>Hostname</dfn> is a fully qualified DNS domain name which can
471 be resolved to one or more <var><a href="#ipaddr">IPAddrs</a></var> via the
472 DNS domain name service. It represents a logical host (in contrast to
473 <var><a href="#domain">Domain</a></var>s, see above) and must be resolvable
474 to at least one <var><a href="#ipaddr">IPAddr</a></var> (or often to a list
475 of hosts with different <var><a href="#ipaddr">IPAddr</a></var>s).</p>
477 <div class="example"><h3>Examples</h3><p><code>
478 prep.ai.example.com<br />
482 <div class="note"><h3>Note</h3>
483 <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
484 DNS lookup can be avoided. Name resolution in Apache can take a remarkable
485 deal of time when the connection to the name server uses a slow PPP
487 <p><var>Hostname</var> comparisons are done without regard to the case,
488 and <var>Hostname</var>s are always assumed to be anchored in the root
489 of the DNS tree, therefore two hosts <code>WWW.ExAmple.com</code>
490 and <code>www.example.com.</code> (note the trailing period) are
491 considered equal.</p>
497 <li><a href="../dns-caveats.html">DNS Issues</a></li>
500 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
501 <div class="directive-section"><h2><a name="Proxy" id="Proxy"><Proxy></a> <a name="proxy" id="proxy">Directive</a></h2>
502 <table class="directive">
503 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Container for directives applied to proxied resources</td></tr>
504 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Proxy <var>wildcard-url</var>> ...</Proxy></code></td></tr>
505 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
506 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
507 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
509 <p>Directives placed in <code class="directive"><Proxy></code>
510 sections apply only to matching proxied content. Shell-style wildcards are
513 <p>For example, the following will allow only hosts in
514 <code>yournetwork.example.com</code> to access content via your proxy
517 <div class="example"><p><code>
518 <Proxy *><br />
519 <span class="indent">
520 Order Deny,Allow<br />
522 Allow from yournetwork.example.com<br />
527 <p>The following example will process all files in the <code>foo</code>
528 directory of <code>example.com</code> through the <code>INCLUDES</code>
529 filter when they are sent through the proxy server:</p>
531 <div class="example"><p><code>
532 <Proxy http://example.com/foo/*><br />
533 <span class="indent">
534 SetOutputFilter INCLUDES<br />
541 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
542 <div class="directive-section"><h2><a name="ProxyBadHeader" id="ProxyBadHeader">ProxyBadHeader</a> <a name="proxybadheader" id="proxybadheader">Directive</a></h2>
543 <table class="directive">
544 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines how to handle bad header lines in a
546 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyBadHeader IsError|Ignore|StartBody</code></td></tr>
547 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyBadHeader IsError</code></td></tr>
548 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
549 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
550 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
551 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.44 and later</td></tr>
553 <p>The <code class="directive">ProxyBadHeader</code> directive determines the
554 behaviour of <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> if it receives syntactically invalid
555 header lines (<em>i.e.</em> containing no colon). The following arguments
559 <dt><code>IsError</code></dt>
560 <dd>Abort the request and end up with a 502 (Bad Gateway) response. This is
561 the default behaviour.</dd>
563 <dt><code>Ignore</code></dt>
564 <dd>Treat bad header lines as if they weren't sent.</dd>
566 <dt><code>StartBody</code></dt>
567 <dd>When receiving the first bad header line, finish reading the headers and
568 treat the remainder as body. This helps to work around buggy backend servers
569 which forget to insert an empty line between the headers and the body.</dd>
573 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
574 <div class="directive-section"><h2><a name="ProxyBlock" id="ProxyBlock">ProxyBlock</a> <a name="proxyblock" id="proxyblock">Directive</a></h2>
575 <table class="directive">
576 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Words, hosts, or domains that are banned from being
578 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyBlock *|<var>word</var>|<var>host</var>|<var>domain</var>
579 [<var>word</var>|<var>host</var>|<var>domain</var>] ...</code></td></tr>
580 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
581 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
582 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
584 <p>The <code class="directive">ProxyBlock</code> directive specifies a list of
585 words, hosts and/or domains, separated by spaces. HTTP, HTTPS, and
586 FTP document requests to sites whose names contain matched words,
587 hosts or domains are <em>blocked</em> by the proxy server. The proxy
588 module will also attempt to determine IP addresses of list items which
589 may be hostnames during startup, and cache them for match test as
590 well. That may slow down the startup time of the server.</p>
592 <div class="example"><h3>Example</h3><p><code>
593 ProxyBlock joes-garage.com some-host.co.uk rocky.wotsamattau.edu
596 <p><code>rocky.wotsamattau.edu</code> would also be matched if referenced by
599 <p>Note that <code>wotsamattau</code> would also be sufficient to match
600 <code>wotsamattau.edu</code>.</p>
602 <p>Note also that</p>
604 <div class="example"><p><code>
608 <p>blocks connections to all sites.</p>
611 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
612 <div class="directive-section"><h2><a name="ProxyDomain" id="ProxyDomain">ProxyDomain</a> <a name="proxydomain" id="proxydomain">Directive</a></h2>
613 <table class="directive">
614 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default domain name for proxied requests</td></tr>
615 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyDomain <var>Domain</var></code></td></tr>
616 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
617 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
618 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
620 <p>This directive is only useful for Apache proxy servers within
621 intranets. The <code class="directive">ProxyDomain</code> directive specifies
622 the default domain which the apache proxy server will belong to. If a
623 request to a host without a domain name is encountered, a redirection
624 response to the same host with the configured <var>Domain</var> appended
625 will be generated.</p>
627 <div class="example"><h3>Example</h3><p><code>
628 ProxyRemote * http://firewall.example.com:81<br />
629 NoProxy .example.com 192.168.112.0/21<br />
630 ProxyDomain .example.com
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="ProxyErrorOverride" id="ProxyErrorOverride">ProxyErrorOverride</a> <a name="proxyerroroverride" id="proxyerroroverride">Directive</a></h2>
636 <table class="directive">
637 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Override error pages for proxied content</td></tr>
638 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyErrorOverride On|Off</code></td></tr>
639 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyErrorOverride Off</code></td></tr>
640 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
641 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
642 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
643 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0 and later</td></tr>
645 <p>This directive is useful for reverse-proxy setups, where you want to
646 have a common look and feel on the error pages seen by the end user.
647 This also allows for included files (via
648 <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>'s SSI) to get
649 the error code and act accordingly (default behavior would display
650 the error page of the proxied server, turning this on shows the SSI
653 <p>This directive does not affect the processing of informational (1xx),
654 normal success (2xx), or redirect (3xx) responses.</p>
657 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
658 <div class="directive-section"><h2><a name="ProxyFtpDirCharset" id="ProxyFtpDirCharset">ProxyFtpDirCharset</a> <a name="proxyftpdircharset" id="proxyftpdircharset">Directive</a></h2>
659 <table class="directive">
660 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Define the character set for proxied FTP listings</td></tr>
661 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyFtpDirCharset <var>character set</var></code></td></tr>
662 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyFtpDirCharset ISO-8859-1</code></td></tr>
663 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
664 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
665 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
666 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.2.7 and later</td></tr>
668 <p>The <code class="directive">ProxyFtpDirCharset</code> directive defines the
669 character set to be set for FTP directory listings in HTML generated by
670 <code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code>.</p>
673 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
674 <div class="directive-section"><h2><a name="ProxyIOBufferSize" id="ProxyIOBufferSize">ProxyIOBufferSize</a> <a name="proxyiobuffersize" id="proxyiobuffersize">Directive</a></h2>
675 <table class="directive">
676 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine size of internal data throughput buffer</td></tr>
677 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyIOBufferSize <var>bytes</var></code></td></tr>
678 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyIOBufferSize 8192</code></td></tr>
679 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
680 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
681 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
683 <p>The <code class="directive">ProxyIOBufferSize</code> directive adjusts the size
684 of the internal buffer, which is used as a scratchpad for the data between
685 input and output. The size must be less or equal <code>65536</code>.</p>
687 <p>In almost every case there's no reason to change that value.</p>
688 <p>If used with AJP this directive sets the maximum AJP packet size in
689 bytes. If you change it from the default, you must also change the
690 <code>packetSize</code> attribute of your AJP connector on the
691 Tomcat side! The attribute <code>packetSize</code> is only available
692 in Tomcat <code>5.5.20+</code> and <code>6.0.2+</code></p>
693 <p>Normally it is not necessary to change the maximum packet size.
694 Problems with the default value have been reported when sending
695 certificates or certificate chains.</p>
699 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
700 <div class="directive-section"><h2><a name="ProxyMatch" id="ProxyMatch"><ProxyMatch></a> <a name="proxymatch" id="proxymatch">Directive</a></h2>
701 <table class="directive">
702 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Container for directives applied to regular-expression-matched
703 proxied resources</td></tr>
704 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><ProxyMatch <var>regex</var>> ...</ProxyMatch></code></td></tr>
705 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
706 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
707 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
709 <p>The <code class="directive"><ProxyMatch></code> directive is
710 identical to the <code class="directive"><a href="#proxy"><Proxy></a></code> directive, except it matches URLs
711 using <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expressions</a>.</p>
714 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
715 <div class="directive-section"><h2><a name="ProxyMaxForwards" id="ProxyMaxForwards">ProxyMaxForwards</a> <a name="proxymaxforwards" id="proxymaxforwards">Directive</a></h2>
716 <table class="directive">
717 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximium number of proxies that a request can be forwarded
719 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyMaxForwards <var>number</var></code></td></tr>
720 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyMaxForwards -1</code></td></tr>
721 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
722 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
723 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
724 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0 and later;
725 default behaviour changed in 2.2.7/2.3</td></tr>
727 <p>The <code class="directive">ProxyMaxForwards</code> directive specifies the
728 maximum number of proxies through which a request may pass, if there's no
729 <code>Max-Forwards</code> header supplied with the request. This may
730 be set to prevent infinite proxy loops, or a DoS attack.</p>
732 <div class="example"><h3>Example</h3><p><code>
736 <p>Note that setting <code class="directive">ProxyMaxForwards</code> is a
737 violation of the HTTP/1.1 protocol (RFC2616), which forbids a Proxy
738 setting <code>Max-Forwards</code> if the Client didn't set it.
739 Earlier Apache versions would always set it. A negative
740 <code class="directive">ProxyMaxForwards</code> value, including the
741 default -1, gives you protocol-compliant behaviour, but may
742 leave you open to loops.</p>
745 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
746 <div class="directive-section"><h2><a name="ProxyPass" id="ProxyPass">ProxyPass</a> <a name="proxypass" id="proxypass">Directive</a></h2>
747 <table class="directive">
748 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps remote servers into the local server URL-space</td></tr>
749 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPass [<var>path</var>] !|<var>url</var> [<var>key=value</var>
750 <var>[key=value</var> ...]] [nocanon] [interpolate]</code></td></tr>
751 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
752 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
753 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
755 <p>This directive allows remote servers to be mapped into the
756 space of the local server; the local server does not act as a
757 proxy in the conventional sense, but appears to be a mirror of the
758 remote server. The local server is often called a <dfn>reverse
759 proxy</dfn> or <dfn>gateway</dfn>. The <var>path</var> is the name of
760 a local virtual path; <var>url</var> is a partial URL for the
761 remote server and cannot include a query string.</p>
763 <div class="warning">The <code class="directive"><a href="#proxyrequests">ProxyRequests</a></code> directive should
764 usually be set <strong>off</strong> when using
765 <code class="directive">ProxyPass</code>.</div>
767 <p>Suppose the local server has address <code>http://example.com/</code>;
770 <div class="example"><p><code>
771 ProxyPass /mirror/foo/ http://backend.example.com/
774 <p>will cause a local request for
775 <code>http://example.com/mirror/foo/bar</code> to be internally converted
776 into a proxy request to <code>http://backend.example.com/bar</code>.</p>
778 <div class="warning">
779 <p>If the first argument ends with a trailing <strong>/</strong>, the second
780 argument should also end with a trailing <strong>/</strong> and vice
781 versa. Otherwise the resulting requests to the backend may miss some
782 needed slashes and do not deliver the expected results.
786 <p>The <code>!</code> directive is useful in situations where you don't want
787 to reverse-proxy a subdirectory, <em>e.g.</em></p>
789 <div class="example"><p><code>
790 ProxyPass /mirror/foo/i !<br />
791 ProxyPass /mirror/foo http://backend.example.com
794 <p>will proxy all requests to <code>/mirror/foo</code> to
795 <code>backend.example.com</code> <em>except</em> requests made to
796 <code>/mirror/foo/i</code>.</p>
798 <div class="note"><h3>Note</h3>
799 <p>Order is important: exclusions must come <em>before</em> the
800 general <code class="directive">ProxyPass</code> directive.</p>
803 <p>As of Apache 2.1, the ability to use pooled connections to a backend
804 server is available. Using the <code>key=value</code> parameters it is
805 possible to tune this connection pooling. The default for a <code>Hard
806 Maximum</code> for the number of connections is the number of threads per
807 process in the active MPM. In the Prefork MPM, this is always 1, while with
808 the Worker MPM it is controlled by the
809 <code class="directive">ThreadsPerChild</code>.</p>
811 <p>Setting <code>min</code> will determine how many connections will always
812 be open to the backend server. Upto the Soft Maximum or <code>smax</code>
813 number of connections will be created on demand. Any connections above
814 <code>smax</code> are subject to a time to live or <code>ttl</code>. Apache
815 will never create more than the Hard Maximum or <code>max</code> connections
816 to the backend server.</p>
818 <div class="example"><p><code>
819 ProxyPass /example http://backend.example.com smax=5 max=20 ttl=120 retry=300
823 <tr><th>Parameter</th>
825 <th>Description</th></tr>
828 <td>Minimum number of connections that will always
829 be open to the backend server.</td></tr>
832 <td>Hard Maximum number of connections that will be
833 allowed to the backend server. The default for a Hard Maximum
834 for the number of connections is the number of threads per process in the
835 active MPM. In the Prefork MPM, this is always 1, while with the Worker MPM
836 it is controlled by the <code class="directive">ThreadsPerChild</code>.
837 Apache will never create more than the Hard Maximum connections
838 to the backend server.</td></tr>
841 <td>Upto the Soft Maximum
842 number of connections will be created on demand. Any connections above
843 <code>smax</code> are subject to a time to live or <code>ttl</code>.
847 <td>If set this will be the maximum time to wait for a free
848 connection in the connection pool, in milliseconds. If there are no free
849 connections in the pool the Apache will return <code>SERVER_BUSY</code>
850 status to the client.
852 <tr><td>connectiontimeout</td>
854 <td>Connect timeout in seconds.
855 The number of seconds Apache waits for the creation of a connection to
856 the backend to complete.
858 <tr><td>disablereuse</td>
860 <td>This parameter should be used when you want to force mod_proxy
861 to immediately close a connection to the backend after being used, and
862 thus, disable its persistent connection and pool for that backend.
863 This helps in various situations where a firewall between Apache and
864 the backend server (regardless of protocol) tends to silently
865 drop connections or when backends themselves may be under round-
866 robin DNS. To disable connection pooling reuse,
867 set this property value to <code>On</code>.
869 <tr><td>flushpackets</td>
871 <td>Determines whether the proxy module will auto-flush the output
872 brigade after each "chunk" of data. 'off' means that it will flush
873 only when needed, 'on' means after each chunk is sent and
874 'auto' means poll/wait for a period of time and flush if
875 no input has been received for 'flushwait' milliseconds.
876 Currently this is in effect only for AJP.
878 <tr><td>flushwait</td>
880 <td>The time to wait for additional input, in milliseconds, before
881 flushing the output brigade if 'flushpackets' is 'auto'.
883 <tr><td>keepalive</td>
885 <td>This parameter should be used when you have a firewall between your
886 Apache and the backend server, who tend to drop inactive connections.
887 This flag will tell the Operating System to send <code>KEEP_ALIVE</code>
888 messages on inactive connections (interval depends on global OS settings,
889 generally 120ms), and thus prevent the firewall to drop the connection.
890 To enable keepalive set this property value to <code>On</code>.
894 <td>Sets the load balancer cluster set that the worker is a member
895 of. The load balancer will try all members of a lower numbered
896 lbset before trying higher numbered ones.
900 <td>Ping property tells webserver to send a <code>CPING</code>
901 request on ajp13 connection before forwarding a request.
902 The parameter is the delay in seconds to wait for the
903 <code>CPONG</code> reply.
904 This features has been added to avoid problem with hung and
905 busy Tomcat's and require ajp13 ping/pong support which has
906 been implemented on Tomcat 3.3.2+, 4.1.28+ and 5.0.13+.
907 This will increase the network traffic during the normal operation
908 which could be an issue, but it will lower the
909 traffic in case some of the cluster nodes are down or busy.
910 Currently this has an effect only for AJP.
912 <tr><td>redirect</td>
914 <td>Redirection Route of the worker. This value is usually
915 set dynamically to enable safe removal of the node from
916 the cluster. If set all requests without session id will be
917 redirected to the BalancerMember that has route parametar
922 <td>Connection pool worker retry timeout in seconds.
923 If the connection pool worker to the backend server is in the error state,
924 Apache will not forward any requests to that server until the timeout
925 expires. This enables to shut down the backend server for maintenance,
926 and bring it back online later. A value of 0 means always retry workers
927 in an error state with no timeout.
931 <td>Route of the worker when used inside load balancer.
932 The route is a value appended to session id.
936 <td>Single letter value defining the initial status of
937 this worker: 'D' is disabled, 'S' is stopped, 'I' is ignore-errors,
938 'H' is hot-standby and 'E' is in an error state. Status
939 can be set (which is the default) by prepending with '+' or
940 cleared by prepending with '-'.
941 Thus, a setting of 'S-E' sets this worker to Stopped and
942 clears the in-error flag.
945 <td><code class="directive"><a href="#proxytimeout">ProxyTimeout</a></code></td>
946 <td>Connection timeout in seconds.
947 The number of seconds Apache waits for data sent by / to the backend.
951 <td>Time To Live for the inactive connections above the
952 <code>smax</code> connections in seconds. Apache will close all
953 connections that has not been used inside that time period.
958 <p>If the Proxy directive scheme starts with the
959 <code>balancer://</code> then a virtual worker that does not really
960 communicate with the backend server will be created. Instead it is responsible
961 for the management of several "real" workers. In that case the special set of
962 parameters can be add to this virtual worker. See <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code>
963 for more information about how the balancer works.
966 <tr><th>Parameter</th>
968 <th>Description</th></tr>
969 <tr><td>lbmethod</td>
971 <td>Balancer load-balance method. Select the load-balancing scheduler
972 method to use. Either <code>byrequests</code>, to perform weighted
973 request counting, <code>bytraffic</code>, to perform weighted
974 traffic byte count balancing, or <code>bybusyness</code>, to perform
975 pending request balancing. Default is <code>byrequests</code>.
977 <tr><td>maxattempts</td>
979 <td>Maximum number of failover attempts before giving up.
981 <tr><td>nofailover</td>
983 <td>If set to <code>On</code> the session will break if the worker is in
984 error state or disabled. Set this value to On if backend servers do not
985 support session replication.
987 <tr><td>stickysession</td>
989 <td>Balancer sticky session name. The value is usually set to something
990 like <code>JSESSIONID</code> or <code>PHPSESSIONID</code>,
991 and it depends on the backend application server that support sessions.
992 If the backend application server uses different name for cookies
993 and url encoded id (like servlet containers) use | to to separate them.
994 The first part is for the cookie the second for the path.
996 <tr><td>scolonpathdelim</td>
998 <td>If set to <code>On</code> the semi-colon character ';' will be
999 used as an additional sticky session path deliminator/separator. This
1000 is mainly used to emulate mod_jk's behavior when dealing with paths such
1001 as <code>JSESSIONID=6736bcf34;foo=aabfa</code>
1003 <tr><td>timeout</td>
1005 <td>Balancer timeout in seconds. If set this will be the maximum time
1006 to wait for a free worker. Default is not to wait.
1010 <p>A sample balancer setup</p>
1011 <div class="example"><p><code>
1012 ProxyPass /special-area http://special.example.com/ smax=5 max=10<br />
1013 ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On<br />
1014 <Proxy balancer://mycluster><br />
1015 <span class="indent">
1016 BalancerMember http://1.2.3.4:8009<br />
1017 BalancerMember http://1.2.3.5:8009 smax=10<br />
1018 # Less powerful server, don't send as many requests there<br />
1019 BalancerMember http://1.2.3.6:8009 smax=1 loadfactor=20<br />
1024 <p>Setting up a hot-standby, that will only be used if no other
1025 members are available</p>
1026 <div class="example"><p><code>
1027 ProxyPass / balancer://hotcluster/ <br />
1028 <Proxy balancer://hotcluster><br />
1029 <span class="indent">
1030 BalancerMember http://1.2.3.4:8009 loadfactor=1<br />
1031 BalancerMember http://1.2.3.5:8009 loadfactor=2<br />
1032 # The below is the hot standby<br />
1033 BalancerMember http://1.2.3.6:8009 status=+H<br />
1034 ProxySet lbmethod=bytraffic
1039 <p>Normally, mod_proxy will canonicalise ProxyPassed URLs.
1040 But this may be incompatible with some backends, particularly those
1041 that make use of <var>PATH_INFO</var>. The optional <var>nocanon</var>
1042 keyword suppresses this, and passes the URL path "raw" to the
1043 backend. Note that may affect the security of your backend, as it
1044 removes the normal limited protection against URL-based attacks
1045 provided by the proxy.</p>
1047 <p>The optional <var>interpolate</var> keyword (available in
1048 httpd 2.2.9 and later), in combination with
1049 <code class="directive">ProxyPassInterpolateEnv</code> causes the ProxyPass
1050 to interpolate environment variables, using the syntax
1051 <var>${VARNAME}</var>. Note that many of the standard CGI-derived
1052 environment variables will not exist when this interpolation happens,
1053 so you may still have to resort to <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
1054 for complex rules.</p>
1056 <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
1057 directory is obtained from the <code class="directive"><a href="../mod/core.html#location"><Location></a></code>.</p>
1059 <p>If you require a more flexible reverse-proxy configuration, see the
1060 <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directive with the
1061 <code>[P]</code> flag.</p>
1064 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1065 <div class="directive-section"><h2><a name="ProxyPassInterpolateEnv" id="ProxyPassInterpolateEnv">ProxyPassInterpolateEnv</a> <a name="proxypassinterpolateenv" id="proxypassinterpolateenv">Directive</a></h2>
1066 <table class="directive">
1067 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable Environment Variable interpolation in Reverse Proxy configurations</td></tr>
1068 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassInterpolateEnv On|Off</code></td></tr>
1069 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyPassInterpolateEnv Off</code></td></tr>
1070 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1071 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1072 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1073 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in httpd 2.2.9 and later</td></tr>
1075 <p>This directive, together with the <var>interpolate</var> argument to
1076 <code class="directive">ProxyPass</code>, <code class="directive">ProxyPassReverse</code>,
1077 <code class="directive">ProxyPassReverseCookieDomain</code> and
1078 <code class="directive">ProxyPassReverseCookiePath</code>
1079 enables reverse proxies to be dynamically
1080 configured using environment variables, which may be set by
1081 another module such as <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>.
1082 It affects the <code class="directive">ProxyPass</code>,
1083 <code class="directive">ProxyPassReverse</code>,
1084 <code class="directive">ProxyPassReverseCookieDomain</code>, and
1085 <code class="directive">ProxyPassReverseCookiePath</code> directives,
1086 and causes them to substitute the value of an environment
1087 variable <code>varname</code> for the string <code>${varname}</code>
1088 in configuration directives.</p>
1089 <p>Keep this turned off (for server performance) unless you need it!</p>
1092 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1093 <div class="directive-section"><h2><a name="ProxyPassMatch" id="ProxyPassMatch">ProxyPassMatch</a> <a name="proxypassmatch" id="proxypassmatch">Directive</a></h2>
1094 <table class="directive">
1095 <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>
1096 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassMatch [<var>regex</var>] !|<var>url</var> [<var>key=value</var>
1097 <var>[key=value</var> ...]]</code></td></tr>
1098 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1099 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1100 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1102 <p>This directive is equivalent to <code class="directive"><a href="#proxypass">ProxyPass</a></code>,
1103 but makes use of regular expressions, instead of simple prefix matching. The
1104 supplied regular expression is matched against the <var>url</var>, and if it
1105 matches, the server will substitute any parenthesized matches into the given
1106 string and use it as a new <var>url</var>.</p>
1108 <p>Suppose the local server has address <code>http://example.com/</code>;
1111 <div class="example"><p><code>
1112 ProxyPassMatch ^(/.*\.gif)$ http://backend.example.com$1
1115 <p>will cause a local request for
1116 <code>http://example.com/mirror/foo/bar.gif</code> to be internally converted
1117 into a proxy request to <code>http://backend.example.com/foo/bar.gif</code>.</p>
1119 <p>The <code>!</code> directive is useful in situations where you don't want
1120 to reverse-proxy a subdirectory.</p>
1123 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1124 <div class="directive-section"><h2><a name="ProxyPassReverse" id="ProxyPassReverse">ProxyPassReverse</a> <a name="proxypassreverse" id="proxypassreverse">Directive</a></h2>
1125 <table class="directive">
1126 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the URL in HTTP response headers sent from a reverse
1127 proxied server</td></tr>
1128 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverse [<var>path</var>] <var>url</var>
1129 [<var>interpolate</var>]</code></td></tr>
1130 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1131 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1132 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1134 <p>This directive lets Apache adjust the URL in the <code>Location</code>,
1135 <code>Content-Location</code> and <code>URI</code> headers on HTTP
1136 redirect responses. This is essential when Apache is used as a
1137 reverse proxy (or gateway) to avoid by-passing the reverse proxy
1138 because of HTTP redirects on the backend servers which stay behind
1139 the reverse proxy.</p>
1141 <p>Only the HTTP response headers specifically mentioned above
1142 will be rewritten. Apache will not rewrite other response
1143 headers, nor will it rewrite URL references inside HTML pages.
1144 This means that if the proxied content contains absolute URL
1145 references, they will by-pass the proxy. A third-party module
1146 that will look inside the HTML and rewrite URL references is Nick
1147 Kew's <a href="http://apache.webthing.com/mod_proxy_html/">mod_proxy_html</a>.</p>
1149 <p><var>path</var> is the name of a local virtual path. <var>url</var> is a
1150 partial URL for the remote server - the same way they are used for the
1151 <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
1153 <p>For example, suppose the local server has address
1154 <code>http://example.com/</code>; then</p>
1156 <div class="example"><p><code>
1157 ProxyPass /mirror/foo/ http://backend.example.com/<br />
1158 ProxyPassReverse /mirror/foo/ http://backend.example.com/<br />
1159 ProxyPassReverseCookieDomain backend.example.com public.example.com<br />
1160 ProxyPassReverseCookiePath / /mirror/foo/
1163 <p>will not only cause a local request for the
1164 <code>http://example.com/mirror/foo/bar</code> to be internally converted
1165 into a proxy request to <code>http://backend.example.com/bar</code>
1166 (the functionality <code>ProxyPass</code> provides here). It also takes care
1167 of redirects the server <code>backend.example.com</code> sends: when
1168 <code>http://backend.example.com/bar</code> is redirected by him to
1169 <code>http://backend.example.com/quux</code> Apache adjusts this to
1170 <code>http://example.com/mirror/foo/quux</code> before forwarding the HTTP
1171 redirect response to the client. Note that the hostname used for
1172 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>
1174 <p>Note that this <code class="directive">ProxyPassReverse</code> directive can
1175 also be used in conjunction with the proxy pass-through feature
1176 (<code>RewriteRule ... [P]</code>) from <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
1177 because it doesn't depend on a corresponding <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
1179 <p>The optional <var>interpolate</var> keyword (available in
1180 httpd 2.2.9 and later), used together with
1181 <code class="directive">ProxyPassInterpolateEnv</code>, enables interpolation
1182 of environment variables specified using the format <var>${VARNAME}</var>.
1185 <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
1186 directory is obtained from the <code class="directive"><a href="../mod/core.html#location"><Location></a></code>.</p>
1189 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1190 <div class="directive-section"><h2><a name="ProxyPassReverseCookieDomain" id="ProxyPassReverseCookieDomain">ProxyPassReverseCookieDomain</a> <a name="proxypassreversecookiedomain" id="proxypassreversecookiedomain">Directive</a></h2>
1191 <table class="directive">
1192 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the Domain string in Set-Cookie headers from a reverse-
1193 proxied server</td></tr>
1194 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverseCookieDomain <var>internal-domain</var>
1195 <var>public-domain</var> [<var>interpolate</var>]</code></td></tr>
1196 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1197 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1198 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1200 <p>Usage is basically similar to
1201 <code class="directive"><a href="#proxypassreverse">ProxyPassReverse</a></code>, but instead of
1202 rewriting headers that are a URL, this rewrites the <code>domain</code>
1203 string in <code>Set-Cookie</code> headers.</p>
1206 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1207 <div class="directive-section"><h2><a name="ProxyPassReverseCookiePath" id="ProxyPassReverseCookiePath">ProxyPassReverseCookiePath</a> <a name="proxypassreversecookiepath" id="proxypassreversecookiepath">Directive</a></h2>
1208 <table class="directive">
1209 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the Path string in Set-Cookie headers from a reverse-
1210 proxied server</td></tr>
1211 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverseCookiePath <var>internal-path</var>
1212 <var>public-path</var> [<var>interpolate</var>]</code></td></tr>
1213 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
1214 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1215 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1217 <p>Usage is basically similar to
1218 <code class="directive"><a href="#proxypassreverse">ProxyPassReverse</a></code>, but instead of
1219 rewriting headers that are a URL, this rewrites the <code>path</code>
1220 string in <code>Set-Cookie</code> headers.</p>
1223 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1224 <div class="directive-section"><h2><a name="ProxyPreserveHost" id="ProxyPreserveHost">ProxyPreserveHost</a> <a name="proxypreservehost" id="proxypreservehost">Directive</a></h2>
1225 <table class="directive">
1226 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use incoming Host HTTP request header for proxy
1228 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPreserveHost On|Off</code></td></tr>
1229 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyPreserveHost Off</code></td></tr>
1230 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1231 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1232 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1233 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.31 and later.</td></tr>
1235 <p>When enabled, this option will pass the Host: line from the incoming
1236 request to the proxied host, instead of the hostname specified in the
1237 <code class="directive">ProxyPass</code> line.</p>
1239 <p>This option should normally be turned <code>Off</code>. It is mostly
1240 useful in special configurations like proxied mass name-based virtual
1241 hosting, where the original Host header needs to be evaluated by the
1245 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1246 <div class="directive-section"><h2><a name="ProxyReceiveBufferSize" id="ProxyReceiveBufferSize">ProxyReceiveBufferSize</a> <a name="proxyreceivebuffersize" id="proxyreceivebuffersize">Directive</a></h2>
1247 <table class="directive">
1248 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Network buffer size for proxied HTTP and FTP
1249 connections</td></tr>
1250 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyReceiveBufferSize <var>bytes</var></code></td></tr>
1251 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyReceiveBufferSize 0</code></td></tr>
1252 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1253 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1254 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1256 <p>The <code class="directive">ProxyReceiveBufferSize</code> directive specifies an
1257 explicit (TCP/IP) network buffer size for proxied HTTP and FTP connections,
1258 for increased throughput. It has to be greater than <code>512</code> or set
1259 to <code>0</code> to indicate that the system's default buffer size should
1262 <div class="example"><h3>Example</h3><p><code>
1263 ProxyReceiveBufferSize 2048
1267 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1268 <div class="directive-section"><h2><a name="ProxyRemote" id="ProxyRemote">ProxyRemote</a> <a name="proxyremote" id="proxyremote">Directive</a></h2>
1269 <table class="directive">
1270 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Remote proxy used to handle certain requests</td></tr>
1271 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRemote <var>match</var> <var>remote-server</var></code></td></tr>
1272 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1273 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1274 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1276 <p>This defines remote proxies to this proxy. <var>match</var> is either the
1277 name of a URL-scheme that the remote server supports, or a partial URL
1278 for which the remote server should be used, or <code>*</code> to indicate
1279 the server should be contacted for all requests. <var>remote-server</var> is
1280 a partial URL for the remote server. Syntax:</p>
1282 <div class="example"><p><code>
1283 <dfn>remote-server</dfn> =
1284 <var>scheme</var>://<var>hostname</var>[:<var>port</var>]
1287 <p><var>scheme</var> is effectively the protocol that should be used to
1288 communicate with the remote server; only <code>http</code> is supported by
1291 <div class="example"><h3>Example</h3><p><code>
1292 ProxyRemote http://goodguys.example.com/ http://mirrorguys.example.com:8000<br />
1293 ProxyRemote * http://cleverproxy.localdomain<br />
1294 ProxyRemote ftp http://ftpproxy.mydomain:8080
1297 <p>In the last example, the proxy will forward FTP requests, encapsulated
1298 as yet another HTTP proxy request, to another proxy which can handle
1301 <p>This option also supports reverse proxy configuration - a backend
1302 webserver can be embedded within a virtualhost URL space even if that
1303 server is hidden by another forward proxy.</p>
1306 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1307 <div class="directive-section"><h2><a name="ProxyRemoteMatch" id="ProxyRemoteMatch">ProxyRemoteMatch</a> <a name="proxyremotematch" id="proxyremotematch">Directive</a></h2>
1308 <table class="directive">
1309 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Remote proxy used to handle requests matched by regular
1310 expressions</td></tr>
1311 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRemoteMatch <var>regex</var> <var>remote-server</var></code></td></tr>
1312 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1313 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1314 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1316 <p>The <code class="directive">ProxyRemoteMatch</code> is identical to the
1317 <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> directive, except the
1318 first argument is a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
1319 match against the requested URL.</p>
1322 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1323 <div class="directive-section"><h2><a name="ProxyRequests" id="ProxyRequests">ProxyRequests</a> <a name="proxyrequests" id="proxyrequests">Directive</a></h2>
1324 <table class="directive">
1325 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables forward (standard) proxy requests</td></tr>
1326 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRequests On|Off</code></td></tr>
1327 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyRequests Off</code></td></tr>
1328 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1329 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1330 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1332 <p>This allows or prevents Apache from functioning as a forward proxy
1333 server. (Setting ProxyRequests to <code>Off</code> does not disable use of
1334 the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.)</p>
1336 <p>In a typical reverse proxy or gateway configuration, this
1337 option should be set to
1338 <code>Off</code>.</p>
1340 <p>In order to get the functionality of proxying HTTP or FTP sites, you
1341 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>
1342 (or both) present in the server.</p>
1344 <div class="warning"><h3>Warning</h3>
1345 <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
1346 both to your network and to the Internet at large.</p>
1351 <li><a href="#forwardreverse">Forward and Reverse Proxies/Gateways</a></li>
1354 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1355 <div class="directive-section"><h2><a name="ProxySet" id="ProxySet">ProxySet</a> <a name="proxyset" id="proxyset">Directive</a></h2>
1356 <table class="directive">
1357 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Set various Proxy balancer or member parameters</td></tr>
1358 <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>
1359 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
1360 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1361 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1362 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>ProxySet is only available in Apache 2.2
1363 and later.</td></tr>
1365 <p>This directive is used as an alternate method of setting any of the
1366 parameters available to Proxy balancers and workers normally done via the
1367 <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive. If used
1368 within a <code><Proxy <var>balancer url|worker url</var>></code>
1369 container directive, the <var>url</var> argument is not required. As a side
1370 effect the respective balancer or worker gets created. This can be useful
1371 when doing reverse proxying via a
1372 <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> instead of a
1373 <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
1375 <div class="example"><p><code>
1376 <Proxy balancer://hotcluster><br />
1377 <span class="indent">
1378 BalancerMember http://www2.example.com:8009 loadfactor=1<br />
1379 BalancerMember http://www3.example.com:8009 loadfactor=2<br />
1380 ProxySet lbmethod=bytraffic<br />
1385 <div class="example"><p><code>
1386 <Proxy http://backend><br />
1387 <span class="indent">
1388 ProxySet keepalive=On<br />
1393 <div class="example"><p><code>
1394 ProxySet balancer://foo lbmethod=bytraffic timeout=15
1397 <div class="example"><p><code>
1398 ProxySet ajp://backend:7001 timeout=15
1401 <div class="warning"><h3>Warning</h3>
1402 <p>Keep in mind that the same parameter key can have a different meaning
1403 depending whether it is applied to a balancer or a worker as shown by the two
1404 examples above regarding timeout.</p>
1409 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1410 <div class="directive-section"><h2><a name="ProxyStatus" id="ProxyStatus">ProxyStatus</a> <a name="proxystatus" id="proxystatus">Directive</a></h2>
1411 <table class="directive">
1412 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Show Proxy LoadBalancer status in mod_status</td></tr>
1413 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyStatus Off|On|Full</code></td></tr>
1414 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyStatus Off</code></td></tr>
1415 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1416 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1417 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1418 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.2 and later</td></tr>
1420 <p>This directive determines whether or not proxy
1421 loadbalancer status data is displayed via the <code class="module"><a href="../mod/mod_status.html">mod_status</a></code>
1422 server-status page.</p>
1423 <div class="note"><h3>Note</h3>
1424 <p><strong>Full</strong> is synonymous with <strong>On</strong></p>
1429 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1430 <div class="directive-section"><h2><a name="ProxyTimeout" id="ProxyTimeout">ProxyTimeout</a> <a name="proxytimeout" id="proxytimeout">Directive</a></h2>
1431 <table class="directive">
1432 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Network timeout for proxied requests</td></tr>
1433 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyTimeout <var>seconds</var></code></td></tr>
1434 <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>
1435 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1436 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1437 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1438 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.31 and later</td></tr>
1440 <p>This directive allows a user to specifiy a timeout on proxy requests.
1441 This is useful when you have a slow/buggy appserver which hangs, and you
1442 would rather just return a timeout and fail gracefully instead of waiting
1443 however long it takes the server to return.</p>
1446 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
1447 <div class="directive-section"><h2><a name="ProxyVia" id="ProxyVia">ProxyVia</a> <a name="proxyvia" id="proxyvia">Directive</a></h2>
1448 <table class="directive">
1449 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Information provided in the <code>Via</code> HTTP response
1450 header for proxied requests</td></tr>
1451 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyVia On|Off|Full|Block</code></td></tr>
1452 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyVia Off</code></td></tr>
1453 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
1454 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
1455 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
1457 <p>This directive controls the use of the <code>Via:</code> HTTP
1458 header by the proxy. Its intended use is to control the flow of
1459 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
1460 14.45 for an explanation of <code>Via:</code> header lines.</p>
1463 <li>If set to <code>Off</code>, which is the default, no special processing
1464 is performed. If a request or reply contains a <code>Via:</code> header,
1465 it is passed through unchanged.</li>
1467 <li>If set to <code>On</code>, each request and reply will get a
1468 <code>Via:</code> header line added for the current host.</li>
1470 <li>If set to <code>Full</code>, each generated <code>Via:</code> header
1471 line will additionally have the Apache server version shown as a
1472 <code>Via:</code> comment field.</li>
1474 <li>If set to <code>Block</code>, every proxy request will have all its
1475 <code>Via:</code> header lines removed. No new <code>Via:</code> header will
1481 <div class="bottomlang">
1482 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy.html" title="English"> en </a> |
1483 <a href="../ja/mod/mod_proxy.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
1484 </div><div id="footer">
1485 <p class="apache">Copyright 2008 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>
1486 <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>