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.1</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-project/">Documentation</a> > <a href="../">Version 2.1</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"> en </a></p>
26 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>HTTP/1.1 proxy/gateway server</td></tr>
27 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
28 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>proxy_module</td></tr>
29 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_proxy.c</td></tr></table>
32 <div class="warning"><h3>Warning</h3>
33 <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
34 network and to the Internet at large.</p>
37 <p>This module implements a proxy/gateway for Apache. It implements
38 proxying capability for <code>FTP</code>, <code>CONNECT</code> (for SSL),
39 <code>HTTP/0.9</code>, <code>HTTP/1.0</code>, and <code>HTTP/1.1</code>.
40 The module can be configured to connect to other proxy modules for these
41 and other protocols.</p>
43 <p>This module was experimental in Apache 1.1.x. Improvements and bugfixes
44 were made in Apache v1.2.x and Apache v1.3.x, then the module underwent a
45 major overhaul for Apache v2.0. The protocol support was upgraded to
46 <code>HTTP/1.1</code>, and filter support was enabled.</p>
48 <p>During the overhaul process the <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> has been
49 splitted into several module files. The accompanying modules distributed
50 with the httpd are <code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code>,
51 <code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code> and <code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code>.
52 Thus if you want to use one or more of the particular proxy functions you
53 have to load <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> <em>and</em> the appropriate
54 module(s) into the server (either statically or dynamically via the
55 <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code> directive).</p>
57 <p>Please note that the <strong>caching</strong> function present in <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> up to Apache v1.3.x has been <strong>removed</strong>
58 from <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> and will be incorporated into a new module,
59 <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>. In other words: the Apache 2.0.x-Proxy doesn't
60 cache at all - all caching functionality has been moved into
61 <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>, which is capable of caching any content, not
62 only content from proxy.</p>
64 <p>If you need to use SSL when contacting remote servers, have a look at the
65 <code>SSLProxy*</code> directives in <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>.</p>
67 <div id="quickview"><h3 class="directives">Directives</h3>
69 <li><img alt="" src="../images/down.gif" /> <a href="#allowconnect">AllowCONNECT</a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#noproxy">NoProxy</a></li>
71 <li><img alt="" src="../images/down.gif" /> <a href="#proxy"><Proxy></a></li>
72 <li><img alt="" src="../images/down.gif" /> <a href="#proxybadheader">ProxyBadHeader</a></li>
73 <li><img alt="" src="../images/down.gif" /> <a href="#proxyblock">ProxyBlock</a></li>
74 <li><img alt="" src="../images/down.gif" /> <a href="#proxydomain">ProxyDomain</a></li>
75 <li><img alt="" src="../images/down.gif" /> <a href="#proxyerroroverride">ProxyErrorOverride</a></li>
76 <li><img alt="" src="../images/down.gif" /> <a href="#proxyiobuffersize">ProxyIOBufferSize</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#proxymatch"><ProxyMatch></a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#proxymaxforwards">ProxyMaxForwards</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#proxypass">ProxyPass</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="#proxypreservehost">ProxyPreserveHost</a></li>
82 <li><img alt="" src="../images/down.gif" /> <a href="#proxyreceivebuffersize">ProxyReceiveBufferSize</a></li>
83 <li><img alt="" src="../images/down.gif" /> <a href="#proxyremote">ProxyRemote</a></li>
84 <li><img alt="" src="../images/down.gif" /> <a href="#proxyremotematch">ProxyRemoteMatch</a></li>
85 <li><img alt="" src="../images/down.gif" /> <a href="#proxyrequests">ProxyRequests</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#proxytimeout">ProxyTimeout</a></li>
87 <li><img alt="" src="../images/down.gif" /> <a href="#proxyvia">ProxyVia</a></li>
91 <li><img alt="" src="../images/down.gif" /> <a href="#configs">Common configuration topics</a></li>
92 </ul><h3>See also</h3>
94 <li><code class="module"><a href="../mod/mod_proxy_http.html">mod_proxy_http</a></code></li>
95 <li><code class="module"><a href="../mod/mod_proxy_ftp.html">mod_proxy_ftp</a></code></li>
96 <li><code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code></li>
97 <li><code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code></li>
99 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
100 <div class="section">
101 <h2><a name="configs" id="configs">Common configuration topics</a></h2>
103 <li><a href="#forwardreverse">Forward and Reverse Proxies</a></li>
104 <li><a href="#access">Controlling access to your proxy</a></li>
105 <li><a href="#mimetypes">Why doesn't file type <var>xxx</var> download via
107 <li><a href="#type">How can I force an FTP ASCII download of File
108 <var>xxx</var>?</a></li>
109 <li><a href="#percent2fhack">How can I access FTP files outside of my home
111 <li><a href="#ftppass">How can I hide the FTP cleartext password in my
112 browser's URL line?</a></li>
113 <li><a href="#startup">Why does Apache start more slowly when using the
114 proxy module?</a></li>
115 <li><a href="#intranet">What other functions are useful for an intranet
116 proxy server?</a></li>
117 <li><a href="#envsettings">How can I make the proxy talk HTTP/1.0 and
118 disable keepalives?</a></li>
121 <h3><a name="forwardreverse" id="forwardreverse">Forward and Reverse Proxies</a></h3>
122 <p>Apache can be configured in both a <dfn>forward</dfn> and
123 <dfn>reverse</dfn> proxy configuration.</p>
125 <p>A <dfn>forward proxy</dfn> is an intermediate system that enables a
126 browser to connect to a remote network to which it normally does not have
127 access. A forward proxy can also be used to cache data, reducing load on
128 the networks between the forward proxy and the remote webserver.</p>
130 <p>Apache's <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> can be figured to behave like a
131 forward proxy using the <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> directive. In addition, caching of data can be
132 achieved by configuring <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>. Other dedicated
133 forward proxy packages include <a href="http://www.squid-cache.org/">Squid</a>.</p>
135 <p>A <dfn>reverse proxy</dfn> is a webserver system that is capable of
136 serving webpages sourced from other webservers - in addition to webpages
137 on disk or generated dynamically by CGI - making these pages look like
138 they originated at the reverse proxy.</p>
140 <p>When configured with the mod_cache module the reverse proxy can act as
141 a cache for slower backend webservers. The reverse proxy can also enable
142 advanced URL strategies and management techniques, allowing webpages
143 served using different webserver systems or architectures to coexist
144 inside the same URL space. Reverse proxy systems are also ideal for
145 implementing centralised logging websites with many or diverse website
146 backends. Complex multi-tier webserver systems can be constructed using an
147 <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> frontend and any number of backend
150 <p>The reverse proxy is configured using the <code class="directive"><a href="#proxypass">ProxyPass</a></code> and <code class="directive"><a href="#proxypassreverse">ProxyPassReverse</a></code> directives. Caching can be
151 enabled using mod_cache as with the forward proxy.</p>
154 <h3><a name="access" id="access">Controlling access to your proxy</a></h3>
155 <p>You can control who can access your proxy via the <code class="directive"><a href="#proxy"><Proxy></a></code> control block using
156 the following example:</p>
158 <div class="example"><p><code>
159 <Proxy *><br />
160 <span class="indent">
161 Order Deny,Allow<br />
163 Allow from 192.168.0<br />
168 <p>When configuring a reverse proxy, access control takes on the
169 attributes of the normal server <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> configuration.</p>
172 <h3><a name="mimetypes" id="mimetypes">Why doesn't file type <var>xxx</var>
173 download via FTP?</a></h3>
174 <p>You probably don't have that particular file type defined as
175 <code>application/octet-stream</code> in your proxy's mime.types
176 configuration file. A useful line can be</p>
178 <div class="example"><pre>application/octet-stream bin dms lha lzh exe class tgz taz</pre></div>
181 <h3><a name="type" id="type">How can I force an FTP ASCII download of
182 File <var>xxx</var>?</a></h3>
183 <p>In the rare situation where you must download a specific file using the
184 FTP <code>ASCII</code> transfer method (while the default transfer is in
185 <code>binary</code> mode), you can override <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>'s
186 default by suffixing the request with <code>;type=a</code> to force an
187 ASCII transfer. (FTP Directory listings are always executed in ASCII mode,
191 <h3><a name="percent2fhck" id="percent2fhck">How can I access FTP files outside
192 of my home directory?</a></h3>
193 <p>An FTP URI is interpreted relative to the home directory of the user
194 who is logging in. Alas, to reach higher directory levels you cannot
195 use /../, as the dots are interpreted by the browser and not actually
196 sent to the FTP server. To address this problem, the so called <dfn>Squid
197 %2f hack</dfn> was implemented in the Apache FTP proxy; it is a
198 solution which is also used by other popular proxy servers like the <a href="http://www.squid-cache.org/">Squid Proxy Cache</a>. By
199 prepending <code>/%2f</code> to the path of your request, you can make
200 such a proxy change the FTP starting directory to <code>/</code> (instead
201 of the home directory). For example, to retrieve the file
202 <code>/etc/motd</code>, you would use the URL:</p>
204 <div class="example"><p><code>
205 ftp://<var>user</var>@<var>host</var>/%2f/etc/motd
209 <h3><a name="ftppass" id="ftppass">How can I hide the FTP cleartext password
210 in my browser's URL line?</a></h3>
211 <p>To log in to an FTP server by username and password, Apache uses
212 different strategies. In absense of a user name and password in the URL
213 altogether, Apache sends an anomymous login to the FTP server,
216 <div class="example"><p><code>
217 user: anonymous<br />
218 password: apache_proxy@
221 <p>This works for all popular FTP servers which are configured for
222 anonymous access.</p>
224 <p>For a personal login with a specific username, you can embed the user
225 name into the URL, like in:</p>
227 <div class="example"><p><code>
228 ftp://<var>username</var>@<var>host</var>/myfile
231 <p>If the FTP server asks for a password when given this username (which
232 it should), then Apache will reply with a <code>401</code> (Authorization
233 required) response, which causes the Browser to pop up the
234 username/password dialog. Upon entering the password, the connection
235 attempt is retried, and if successful, the requested resource is
236 presented. The advantage of this procedure is that your browser does not
237 display the password in cleartext (which it would if you had used</p>
239 <div class="example"><p><code>
240 ftp://<var>username</var>:<var>password</var>@<var>host</var>/myfile
243 <p>in the first place).</p>
245 <div class="note"><h3>Note</h3>
246 <p>The password which is transmitted in such a way is not encrypted on
247 its way. It travels between your browser and the Apache proxy server in
248 a base64-encoded cleartext string, and between the Apache proxy and the
249 FTP server as plaintext. You should therefore think twice before
250 accessing your FTP server via HTTP (or before accessing your personal
251 files via FTP at all!) When using unsecure channels, an eavesdropper
252 might intercept your password on its way.</p>
256 <h3><a name="startup" id="startup">Why does Apache start more slowly when using
257 the proxy module?</a></h3>
258 <p>If you're using the <code class="directive"><a href="#proxyblock">ProxyBlock</a></code> directive, hostnames' IP addresses are looked up
259 and cached during startup for later match test. This may take a few
260 seconds (or more) depending on the speed with which the hostname lookups
264 <h3><a name="intranet" id="intranet">What other functions are useful for an
265 intranet proxy server?</a></h3>
266 <p>An Apache proxy server situated in an intranet needs to forward
267 external requests through the company's firewall. However, when it has to
268 access resources within the intranet, it can bypass the firewall when
269 accessing hosts. The <code class="directive"><a href="#noproxy">NoProxy</a></code>
270 directive is useful for specifying which hosts belong to the intranet and
271 should be accessed directly.</p>
273 <p>Users within an intranet tend to omit the local domain name from their
274 WWW requests, thus requesting "http://somehost/" instead of
275 <code>http://somehost.example.com/</code>. Some commercial proxy servers
276 let them get away with this and simply serve the request, implying a
277 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
278 a redirect response and send the client to the correct, fully qualified,
279 server address. This is the preferred method since the user's bookmark
280 files will then contain fully qualified hosts.</p>
283 <h3><a name="envsettings" id="envsettings">How can I make the proxy talk HTTP/1.0 and
284 disable keepalives?</a></h3>
285 <p>For circumstances where you have a application server which doesn't
286 implement keepalives or HTTP/1.1 properly, there are 2 environment
287 variables which when set send a HTTP/1.0 with no keepalive. These are set
288 via the <code class="directive"><a href="../mod/mod_env.html#setenv">SetEnv</a></code> directive.</p>
290 <p>These are the <code>force-proxy-request-1.0</code> and
291 <code>proxy-nokeepalive</code> notes.</p>
293 <div class="example"><p><code>
294 <Location /buggyappserver/><br />
295 <span class="indent">
296 ProxyPass http://buggyappserver:7001/foo/<br />
297 SetEnv force-proxy-request-1.0 1<br />
298 SetEnv proxy-nokeepalive 1<br />
304 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
305 <div class="directive-section"><h2><a name="AllowCONNECT" id="AllowCONNECT">AllowCONNECT</a> <a name="allowconnect" id="allowconnect">Directive</a></h2>
306 <table class="directive">
307 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Ports that are allowed to CONNECT through the
309 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowCONNECT <var>port</var> [<var>port</var>] ...</code></td></tr>
310 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowCONNECT 443 563</code></td></tr>
311 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
312 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
313 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
315 <p>The <code class="directive">AllowCONNECT</code> directive specifies a list
316 of port numbers to which the proxy <code>CONNECT</code> method may
317 connect. Today's browsers use this method when a <code>https</code>
318 connection is requested and proxy tunneling over HTTP is in effect.</p>
320 <p>By default, only the default https port (<code>443</code>) and the
321 default snews port (<code>563</code>) are enabled. Use the
322 <code class="directive">AllowCONNECT</code> directive to override this default and
323 allow connections to the listed ports only.</p>
325 <p>Note that you'll need to have <code class="module"><a href="../mod/mod_proxy_connect.html">mod_proxy_connect</a></code> present
326 in the server in order to get the support for the <code>CONNECT</code> at
330 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
331 <div class="directive-section"><h2><a name="NoProxy" id="NoProxy">NoProxy</a> <a name="noproxy" id="noproxy">Directive</a></h2>
332 <table class="directive">
333 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hosts, domains, or networks that will be connected to
335 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NoProxy <var>host</var> [<var>host</var>] ...</code></td></tr>
336 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
337 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
338 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
340 <p>This directive is only useful for Apache proxy servers within
341 intranets. The <code class="directive">NoProxy</code> directive specifies a
342 list of subnets, IP addresses, hosts and/or domains, separated by
343 spaces. A request to a host which matches one or more of these is
344 always served directly, without forwarding to the configured
345 <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> proxy server(s).</p>
347 <div class="example"><h3>Example</h3><p><code>
348 ProxyRemote * http://firewall.mycompany.com:81<br />
349 NoProxy .mycompany.com 192.168.112.0/21
352 <p>The <var>host</var> arguments to the <code class="directive">NoProxy</code>
353 directive are one of the following type list:</p>
357 <dt><var><a name="domain" id="domain">Domain</a></var></dt>
359 <p>A <dfn>Domain</dfn> is a partially qualified DNS domain name, preceded
360 by a period. It represents a list of hosts which logically belong to the
361 same DNS domain or zone (<em>i.e.</em>, the suffixes of the hostnames are
362 all ending in <var>Domain</var>).</p>
364 <div class="example"><h3>Examples</h3><p><code>
368 <p>To distinguish <var>Domain</var>s from <var><a href="#hostname">Hostname</a></var>s (both syntactically and semantically; a DNS domain can
369 have a DNS A record, too!), <var>Domain</var>s are always written with a
372 <div class="note"><h3>Note</h3>
373 <p>Domain name comparisons are done without regard to the case, and
374 <var>Domain</var>s are always assumed to be anchored in the root of the
375 DNS tree, therefore two domains <code>.MyDomain.com</code> and
376 <code>.mydomain.com.</code> (note the trailing period) are considered
377 equal. Since a domain comparison does not involve a DNS lookup, it is much
378 more efficient than subnet comparison.</p>
382 <dt><var><a name="subnet" id="subnet">SubNet</a></var></dt>
384 <p>A <dfn>SubNet</dfn> is a partially qualified internet address in
385 numeric (dotted quad) form, optionally followed by a slash and the netmask,
386 specified as the number of significant bits in the <var>SubNet</var>. It is
387 used to represent a subnet of hosts which can be reached over a common
388 network interface. In the absence of the explicit net mask it is assumed
389 that omitted (or zero valued) trailing digits specify the mask. (In this
390 case, the netmask can only be multiples of 8 bits wide.) Examples:</p>
393 <dt><code>192.168</code> or <code>192.168.0.0</code></dt>
394 <dd>the subnet 192.168.0.0 with an implied netmask of 16 valid bits
395 (sometimes used in the netmask form <code>255.255.0.0</code>)</dd>
396 <dt><code>192.168.112.0/21</code></dt>
397 <dd>the subnet <code>192.168.112.0/21</code> with a netmask of 21
398 valid bits (also used in the form 255.255.248.0)</dd>
401 <p>As a degenerate case, a <em>SubNet</em> with 32 valid bits is the
402 equivalent to an <var><a href="#ipadr">IPAddr</a></var>, while a <var>SubNet</var> with zero
403 valid bits (<em>e.g.</em>, 0.0.0.0/0) is the same as the constant
404 <var>_Default_</var>, matching any IP address.</p></dd>
407 <dt><var><a name="ipaddr" id="ipaddr">IPAddr</a></var></dt>
409 <p>A <dfn>IPAddr</dfn> represents a fully qualified internet address in
410 numeric (dotted quad) form. Usually, this address represents a host, but
411 there need not necessarily be a DNS domain name connected with the
413 <div class="example"><h3>Example</h3><p><code>
417 <div class="note"><h3>Note</h3>
418 <p>An <var>IPAddr</var> does not need to be resolved by the DNS system, so
419 it can result in more effective apache performance.</p>
423 <dt><var><a name="hostname" id="hostname">Hostname</a></var></dt>
425 <p>A <dfn>Hostname</dfn> is a fully qualified DNS domain name which can
426 be resolved to one or more <var><a href="#ipaddr">IPAddrs</a></var> via the
427 DNS domain name service. It represents a logical host (in contrast to
428 <var><a href="#domain">Domain</a></var>s, see above) and must be resolvable
429 to at least one <var><a href="#ipaddr">IPAddr</a></var> (or often to a list
430 of hosts with different <var><a href="#ipaddr">IPAddr</a></var>s).</p>
432 <div class="example"><h3>Examples</h3><p><code>
433 prep.ai.mit.edu<br />
437 <div class="note"><h3>Note</h3>
438 <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
439 DNS lookup can be avoided. Name resolution in Apache can take a remarkable
440 deal of time when the connection to the name server uses a slow PPP
442 <p><var>Hostname</var> comparisons are done without regard to the case,
443 and <var>Hostname</var>s are always assumed to be anchored in the root
444 of the DNS tree, therefore two hosts <code>WWW.MyDomain.com</code>
445 and <code>www.mydomain.com.</code> (note the trailing period) are
446 considered equal.</p>
452 <li><a href="../dns-caveats.html">DNS Issues</a></li>
455 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
456 <div class="directive-section"><h2><a name="Proxy" id="Proxy"><Proxy></a> <a name="proxy" id="proxy">Directive</a></h2>
457 <table class="directive">
458 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Container for directives applied to proxied resources</td></tr>
459 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Proxy <var>wildcard-url</var>> ...</Proxy></code></td></tr>
460 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
461 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
462 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
464 <p>Directives placed in <code class="directive"><Proxy></code>
465 sections apply only to matching proxied content. Shell-style wildcards are
468 <p>For example, the following will allow only hosts in
469 <code>yournetwork.example.com</code> to access content via your proxy
472 <div class="example"><p><code>
473 <Proxy *><br />
474 <span class="indent">
475 Order Deny,Allow<br />
477 Allow from yournetwork.example.com<br />
482 <p>The following example will process all files in the <code>foo</code>
483 directory of <code>example.com</code> through the <code>INCLUDES</code>
484 filter when they are sent through the proxy server:</p>
486 <div class="example"><p><code>
487 <Proxy http://example.com/foo/*><br />
488 <span class="indent">
489 SetOutputFilter INCLUDES<br />
495 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
496 <div class="directive-section"><h2><a name="ProxyBadHeader" id="ProxyBadHeader">ProxyBadHeader</a> <a name="proxybadheader" id="proxybadheader">Directive</a></h2>
497 <table class="directive">
498 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines how to handle bad header lines in a
500 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyBadHeader IsError|Ignore|StartBody</code></td></tr>
501 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyBadHeader IsError</code></td></tr>
502 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
503 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
504 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
505 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>available in Apache 2.0.44 and later</td></tr>
507 <p>The <code class="directive">ProxyBadHeader</code> directive determines the
508 behaviour of <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> if it receives syntactically invalid
509 header lines (<em>i.e.</em> containing no colon). The following arguments
513 <dt><code>IsError</code></dt>
514 <dd>Abort the request and end up with a 502 (Bad Gateway) response. This is
515 the default behaviour.</dd>
517 <dt><code>Ignore</code></dt>
518 <dd>Treat bad header lines as if they weren't sent.</dd>
520 <dt><code>StartBody</code></dt>
521 <dd>When receiving the first bad header line, finish reading the headers and
522 treat the remainder as body. This helps to work around buggy backend servers
523 which forget to insert an empty line between the headers and the body.</dd>
527 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
528 <div class="directive-section"><h2><a name="ProxyBlock" id="ProxyBlock">ProxyBlock</a> <a name="proxyblock" id="proxyblock">Directive</a></h2>
529 <table class="directive">
530 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Words, hosts, or domains that are banned from being
532 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyBlock *|<var>word</var>|<var>host</var>|<var>domain</var>
533 [<var>word</var>|<var>host</var>|<var>domain</var>] ...</code></td></tr>
534 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
535 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
536 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
538 <p>The <code class="directive">ProxyBlock</code> directive specifies a list of
539 words, hosts and/or domains, separated by spaces. HTTP, HTTPS, and
540 FTP document requests to sites whose names contain matched words,
541 hosts or domains are <em>blocked</em> by the proxy server. The proxy
542 module will also attempt to determine IP addresses of list items which
543 may be hostnames during startup, and cache them for match test as
544 well. That may slow down the startup time of the server.</p>
546 <div class="example"><h3>Example</h3><p><code>
547 ProxyBlock joes-garage.com some-host.co.uk rocky.wotsamattau.edu
550 <p><code>rocky.wotsamattau.edu</code> would also be matched if referenced by
553 <p>Note that <code>wotsamattau</code> would also be sufficient to match
554 <code>wotsamattau.edu</code>.</p>
556 <p>Note also that</p>
558 <div class="example"><p><code>
562 <p>blocks connections to all sites.</p>
565 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
566 <div class="directive-section"><h2><a name="ProxyDomain" id="ProxyDomain">ProxyDomain</a> <a name="proxydomain" id="proxydomain">Directive</a></h2>
567 <table class="directive">
568 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default domain name for proxied requests</td></tr>
569 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyDomain <var>Domain</var></code></td></tr>
570 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
571 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
572 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
574 <p>This directive is only useful for Apache proxy servers within
575 intranets. The <code class="directive">ProxyDomain</code> directive specifies
576 the default domain which the apache proxy server will belong to. If a
577 request to a host without a domain name is encountered, a redirection
578 response to the same host with the configured <var>Domain</var> appended
579 will be generated.</p>
581 <div class="example"><h3>Example</h3><p><code>
582 ProxyRemote * http://firewall.mycompany.com:81<br />
583 NoProxy .mycompany.com 192.168.112.0/21<br />
584 ProxyDomain .mycompany.com
588 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
589 <div class="directive-section"><h2><a name="ProxyErrorOverride" id="ProxyErrorOverride">ProxyErrorOverride</a> <a name="proxyerroroverride" id="proxyerroroverride">Directive</a></h2>
590 <table class="directive">
591 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Override error pages for proxied content</td></tr>
592 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyErrorOverride On|Off</code></td></tr>
593 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyErrorOverride Off</code></td></tr>
594 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
595 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
596 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
597 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0 and later</td></tr>
599 <p>This directive is useful for reverse-proxy setups, where you want to
600 have a common look and feel on the error pages seen by the end user.
601 This also allows for included files (via mod_include's SSI) to get
602 the error code and act accordingly (default behavior would display
603 the error page of the proxied server, turning this on shows the SSI
607 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
608 <div class="directive-section"><h2><a name="ProxyIOBufferSize" id="ProxyIOBufferSize">ProxyIOBufferSize</a> <a name="proxyiobuffersize" id="proxyiobuffersize">Directive</a></h2>
609 <table class="directive">
610 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine size of internal data throughput buffer</td></tr>
611 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyIOBufferSize <var>bytes</var></code></td></tr>
612 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyIOBufferSize 8192</code></td></tr>
613 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
614 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
615 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
617 <p>The <code class="directive">ProxyIOBufferSize</code> directive adjusts the size
618 of the internal buffer, which is used as a scratchpad for the data between
619 input and output. The size must be less or equal <code>8192</code>.</p>
621 <p>In almost every case there's no reason to change that value.</p>
624 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
625 <div class="directive-section"><h2><a name="ProxyMatch" id="ProxyMatch"><ProxyMatch></a> <a name="proxymatch" id="proxymatch">Directive</a></h2>
626 <table class="directive">
627 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Container for directives applied to regular-expression-matched
628 proxied resources</td></tr>
629 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><ProxyMatch <var>regex</var>> ...</ProxyMatch></code></td></tr>
630 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
631 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
632 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
634 <p>The <code class="directive"><ProxyMatch></code> directive is
635 identical to the <code class="directive"><a href="#proxy"><Proxy></a></code> directive, except it matches URLs
636 using regular expressions.</p>
639 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
640 <div class="directive-section"><h2><a name="ProxyMaxForwards" id="ProxyMaxForwards">ProxyMaxForwards</a> <a name="proxymaxforwards" id="proxymaxforwards">Directive</a></h2>
641 <table class="directive">
642 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximium number of proxies that a request can be forwarded
644 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyMaxForwards <var>number</var></code></td></tr>
645 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyMaxForwards 10</code></td></tr>
646 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
647 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
648 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
649 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0 and later</td></tr>
651 <p>The <code class="directive">ProxyMaxForwards</code> directive specifies the
652 maximum number of proxies through which a request may pass, if there's no
653 <code>Max-Forwards</code> header supplied with the request. This is
654 set to prevent infinite proxy loops, or a DoS attack.</p>
656 <div class="example"><h3>Example</h3><p><code>
661 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
662 <div class="directive-section"><h2><a name="ProxyPass" id="ProxyPass">ProxyPass</a> <a name="proxypass" id="proxypass">Directive</a></h2>
663 <table class="directive">
664 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maps remote servers into the local server URL-space</td></tr>
665 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPass [<var>path</var>] !|<var>url</var></code></td></tr>
666 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
667 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
668 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
670 <p>This directive allows remote servers to be mapped into the space of
671 the local server; the local server does not act as a proxy in the
672 conventional sense, but appears to be a mirror of the remote
673 server. <var>path</var> is the name of a local virtual path; <var>url</var>
674 is a partial URL for the remote server and cannot include a query
677 <p>Suppose the local server has address <code>http://example.com/</code>;
680 <div class="example"><p><code>
681 ProxyPass /mirror/foo/ http://backend.example.com/
684 <p>will cause a local request for
685 <code>http://example.com/mirror/foo/bar</code> to be internally converted
686 into a proxy request to <code>http://backend.example.com/bar</code>.</p>
688 <p>The <code>!</code> directive is useful in situations where you don't want
689 to reverse-proxy a subdirectory, <em>e.g.</em></p>
691 <div class="example"><p><code>
692 ProxyPass /mirror/foo/i !<br />
693 ProxyPass /mirror/foo http://backend.example.com
696 <p>will proxy all requests to <code>/mirror/foo</code> to
697 <code>backend.example.com</code> <em>except</em> requests made to
698 <code>/mirror/foo/i</code>.</p>
700 <div class="note"><h3>Note</h3>
701 <p>Order is important. you need to put the exclusions <em>before</em> the
702 general proxypass directive.</p>
705 <p>When used inside a <code class="directive"><a href="../mod/core.html#location"><Location></a></code> section, the first argument is ommitted and the local
706 directory is obtained from the <code class="directive"><a href="../mod/core.html#location"><Location></a></code>.</p>
708 <p>If you require a more flexible reverse-proxy configuration, see the
709 <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directive with the
710 <code>[P]</code> flag.</p>
713 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
714 <div class="directive-section"><h2><a name="ProxyPassReverse" id="ProxyPassReverse">ProxyPassReverse</a> <a name="proxypassreverse" id="proxypassreverse">Directive</a></h2>
715 <table class="directive">
716 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adjusts the URL in HTTP response headers sent from a reverse
717 proxied server</td></tr>
718 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPassReverse [<var>path</var>] <var>url</var></code></td></tr>
719 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
720 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
721 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
723 <p>This directive lets Apache adjust the URL in the <code>Location</code>,
724 <code>Content-Location</code> and <code>URI</code> headers on HTTP redirect
725 responses. This is essential when Apache is used as a reverse proxy to avoid
726 by-passing the reverse proxy because of HTTP redirects on the backend
727 servers which stay behind the reverse proxy.</p>
729 <p><var>path</var> is the name of a local virtual path. <var>url</var> is a
730 partial URL for the remote server - the same way they are used for the
731 <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
733 <p>For example, suppose the local server has address
734 <code>http://example.com/</code>; then</p>
736 <div class="example"><p><code>
737 ProxyPass /mirror/foo/ http://backend.example.com/<br />
738 ProxyPassReverse /mirror/foo/ http://backend.example.com/
741 <p>will not only cause a local request for the
742 <code>http://example.com/mirror/foo/bar</code> to be internally converted
743 into a proxy request to <code>http://backend.example.com/bar</code>
744 (the functionality <code>ProxyPass</code> provides here). It also takes care
745 of redirects the server <code>backend.example.com</code> sends: when
746 <code>http://backend.example.com/bar</code> is redirected by him to
747 <code>http://backend.example.com/quux</code> Apache adjusts this to
748 <code>http://example.com/mirror/foo/quux</code> before forwarding the HTTP
749 redirect response to the client. Note that the hostname used for
750 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>
752 <p>Note that this <code class="directive">ProxyPassReverse</code> directive can
753 also be used in conjunction with the proxy pass-through feature
754 (<code>RewriteRule ... [P]</code>) from <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>
755 because its doesn't depend on a corresponding <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.</p>
757 <p>When used inside a <code class="directive"><a href="../mod/core.html#location"><Location></a></code> section, the first argument is ommitted and the local
758 directory is obtained from the <code class="directive"><a href="../mod/core.html#location"><Location></a></code>.</p>
761 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
762 <div class="directive-section"><h2><a name="ProxyPreserveHost" id="ProxyPreserveHost">ProxyPreserveHost</a> <a name="proxypreservehost" id="proxypreservehost">Directive</a></h2>
763 <table class="directive">
764 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use incoming Host HTTP request header for proxy
766 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyPreserveHost On|Off</code></td></tr>
767 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyPreserveHost Off</code></td></tr>
768 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
769 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
770 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
771 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.31 and later.</td></tr>
773 <p>When enabled, this option will pass the Host: line from the incoming
774 request to the proxied host, instead of the hostname specified in the
777 <p>This option should normally be turned <code>Off</code>. It is mostly
778 useful in special configurations like proxied mass name-based virtual
779 hosting, where the original Host header needs to be evaluated by the
783 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
784 <div class="directive-section"><h2><a name="ProxyReceiveBufferSize" id="ProxyReceiveBufferSize">ProxyReceiveBufferSize</a> <a name="proxyreceivebuffersize" id="proxyreceivebuffersize">Directive</a></h2>
785 <table class="directive">
786 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Network buffer size for proxied HTTP and FTP
787 connections</td></tr>
788 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyReceiveBufferSize <var>bytes</var></code></td></tr>
789 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyReceiveBufferSize 0</code></td></tr>
790 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
791 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
792 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
794 <p>The <code class="directive">ProxyReceiveBufferSize</code> directive specifies an
795 explicit (TCP/IP) network buffer size for proxied HTTP and FTP connections,
796 for increased throughput. It has to be greater than <code>512</code> or set
797 to <code>0</code> to indicate that the system's default buffer size should
800 <div class="example"><h3>Example</h3><p><code>
801 ProxyReceiveBufferSize 2048
805 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
806 <div class="directive-section"><h2><a name="ProxyRemote" id="ProxyRemote">ProxyRemote</a> <a name="proxyremote" id="proxyremote">Directive</a></h2>
807 <table class="directive">
808 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Remote proxy used to handle certain requests</td></tr>
809 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRemote <var>match</var> <var>remote-server</var></code></td></tr>
810 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
811 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
812 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
814 <p>This defines remote proxies to this proxy. <var>match</var> is either the
815 name of a URL-scheme that the remote server supports, or a partial URL
816 for which the remote server should be used, or <code>*</code> to indicate
817 the server should be contacted for all requests. <var>remote-server</var> is
818 a partial URL for the remote server. Syntax:</p>
820 <div class="example"><p><code>
821 <dfn>remote-server</dfn> =
822 <var>scheme</var>://<var>hostname</var>[:<var>port</var>]
825 <p><var>scheme</var> is effectively the protocol that should be used to
826 communicate with the remote server; only <code>http</code> is supported by
829 <div class="example"><h3>Example</h3><p><code>
830 ProxyRemote http://goodguys.com/ http://mirrorguys.com:8000<br />
831 ProxyRemote * http://cleversite.com<br />
832 ProxyRemote ftp http://ftpproxy.mydomain.com:8080
835 <p>In the last example, the proxy will forward FTP requests, encapsulated
836 as yet another HTTP proxy request, to another proxy which can handle
839 <p>This option also supports reverse proxy configuration - a backend
840 webserver can be embedded within a virtualhost URL space even if that
841 server is hidden by another forward proxy.</p>
844 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
845 <div class="directive-section"><h2><a name="ProxyRemoteMatch" id="ProxyRemoteMatch">ProxyRemoteMatch</a> <a name="proxyremotematch" id="proxyremotematch">Directive</a></h2>
846 <table class="directive">
847 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Remote proxy used to handle requests matched by regular
848 expressions</td></tr>
849 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRemoteMatch <var>regex</var> <var>remote-server</var></code></td></tr>
850 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
851 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
852 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
854 <p>The <code class="directive">ProxyRemoteMatch</code> is identical to the
855 <code class="directive"><a href="#proxyremote">ProxyRemote</a></code> directive, except the
856 first argument is a regular expression match against the requested URL.</p>
859 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
860 <div class="directive-section"><h2><a name="ProxyRequests" id="ProxyRequests">ProxyRequests</a> <a name="proxyrequests" id="proxyrequests">Directive</a></h2>
861 <table class="directive">
862 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables forward (standard) proxy requests</td></tr>
863 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyRequests On|Off</code></td></tr>
864 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyRequests Off</code></td></tr>
865 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
866 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
867 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
869 <p>This allows or prevents Apache from functioning as a forward proxy
870 server. (Setting ProxyRequests to <code>Off</code> does not disable use of
871 the <code class="directive"><a href="#proxypass">ProxyPass</a></code> directive.)</p>
873 <p>In a typical reverse proxy configuration, this option should be set to
874 <code>Off</code>.</p>
876 <p>In order to get the functionality of proxying HTTP or FTP sites, you
877 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>
878 (or both) present in the server.</p>
880 <div class="warning"><h3>Warning</h3>
881 <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
882 both to your network and to the Internet at large.</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="ProxyTimeout" id="ProxyTimeout">ProxyTimeout</a> <a name="proxytimeout" id="proxytimeout">Directive</a></h2>
888 <table class="directive">
889 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Network timeout for proxied requests</td></tr>
890 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyTimeout <var>seconds</var></code></td></tr>
891 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyTimeout 300</code></td></tr>
892 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</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>
895 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.31 and later</td></tr>
897 <p>This directive allows a user to specifiy a timeout on proxy requests.
898 This is useful when you have a slow/buggy appserver which hangs, and you
899 would rather just return a timeout and fail gracefully instead of waiting
900 however long it takes the server to return.</p>
903 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
904 <div class="directive-section"><h2><a name="ProxyVia" id="ProxyVia">ProxyVia</a> <a name="proxyvia" id="proxyvia">Directive</a></h2>
905 <table class="directive">
906 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Information provided in the Via HTTP response
907 header for proxied requests</td></tr>
908 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxyVia On|Off|Full|Block</code></td></tr>
909 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxyVia Off</code></td></tr>
910 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
911 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
912 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy</td></tr>
914 <p>This directive controls the use of the <code>Via:</code> HTTP
915 header by the proxy. Its intended use is to control the flow of of
916 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
917 14.45 for an explanation of <code>Via:</code> header lines.</p>
920 <li>If set to <code>Off</code>, which is the default, no special processing
921 is performed. If a request or reply contains a <code>Via:</code> header,
922 it is passed through unchanged.</li>
924 <li>If set to <code>On</code>, each request and reply will get a
925 <code>Via:</code> header line added for the current host.</li>
927 <li>If set to <code>Full</code>, each generated <code>Via:</code> header
928 line will additionally have the Apache server version shown as a
929 <code>Via:</code> comment field.</li>
931 <li>If set to <code>Block</code>, every proxy request will have all its
932 <code>Via:</code> header lines removed. No new <code>Via:</code> header will
938 <div class="bottomlang">
939 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy.html"> en </a></p>
940 </div><div id="footer">
941 <p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p>
942 <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>