mod_proxy.html revision 44afbb2bc1622ddf021058e2a157cfd31fb67fd0
4632N/A<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
4632N/A<HTML>
4632N/A<HEAD>
4632N/A<TITLE>Apache module mod_proxy</TITLE>
4632N/A</HEAD>
4632N/A
4632N/A<BODY>
4632N/A<!--#include virtual="header.html" -->
4632N/A<H1>Apache module mod_proxy</h1>
4632N/A
4632N/AThis module is contained in the <code>mod_proxy.c</code> file, and
4632N/Ais not compiled in by default. It provides for a caching proxy server.
4632N/AIt is only available in Apache 1.1 and later.
4632N/A
4632N/A<h3>Note:</h3>
4632N/A<p>This module is experimental. Use at your own risk.</p>
4632N/A
4632N/A<h2>Summary</h2>
4632N/A
4632N/AThis module implements a proxy/cache for Apache. It implements
4632N/Aproxying capability for
4632N/A<code>FTP</code>,
4632N/A<code>HTTP/0.9</code>, and
4632N/A<code>HTTP/1.0</code>.
4632N/AThe module can be configured to connect to other proxy modules for these
4632N/Aand other protocols.
4632N/A
4632N/A<h2>Directives</h2>
4632N/A<ul>
4632N/A<li><a href="#proxyrequests">ProxyRequests</a>
4632N/A<li><a href="#proxyremote">ProxyRemote</a>
4632N/A<li><a href="#proxypass">ProxyPass</a>
4632N/A<li><a href="#cacheroot">CacheRoot</a>
4632N/A<li><a href="#cachesize">CacheSize</a>
4632N/A<li><a href="#cachegcinterval">CacheGcInterval</a>
4632N/A<li><a href="#cachemaxexpire">CacheMaxExpire</a>
4632N/A<li><a href="#cachelastmodifiedfactor">CacheLastModifiedFactor</a>
4632N/A<li><a href="#cachedefaultexpire">CacheDefaultExpire</a>
4632N/A<li><a href="#nocache">NoCache</a>
4632N/A</ul>
4632N/A
4632N/A<hr>
4632N/A
4632N/A<A name="proxyrequests"><h2>ProxyRequests</h2></A>
4632N/A<strong>Syntax:</strong> ProxyRequests <em>on/off</em><br>
4632N/A<strong>Default:</strong> <code>ProxyRequests Off</code><br>
4632N/A<strong>Context:</strong> server config<br>
4632N/A<strong>Status:</strong> Base<br>
4632N/A<strong>Module:</strong> mod_proxy<br>
4632N/A<strong>Compatibility:</strong> ProxyRequest is only available in
4632N/AApache 1.1 and later.<p>
4632N/A
4632N/AThis allows or prevents Apache from functioning as a proxy
4632N/Aserver. Setting ProxyRequests to 'off' does not disable use of the <a
4632N/Ahref="#proxypass">ProxyPass</a> directive.
4632N/A
4632N/A<A name="proxyremote"><h2>ProxyRemote</h2></A>
4632N/A<strong>Syntax:</strong> ProxyRemote <em>&lt;match&gt; &lt;remote-server&gt;</em><br>
4632N/A<strong>Context:</strong> server config<br>
4632N/A<strong>Status:</strong> Base<br>
4632N/A<strong>Module:</strong> mod_proxy<br>
4632N/A<strong>Compatibility:</strong> ProxyRemote is only available in
4632N/AApache 1.1 and later.<p>
4632N/A
4632N/AThis defines remote proxies to this proxy. &lt;match&gt; is either the
4632N/Aname of a URL-scheme that the remote server supports, or a partial URL
4632N/Afor which the remote server should be used, or '$' to indicate the
4632N/Aserver should be contacted for all requests. &lt;remote-server&gt; is a
4632N/Apartial URL for the remote server. Syntax:
4632N/A
4632N/A<pre>
4632N/A &lt;remote-server&gt; = &lt;protocol&gt;://&lt;hostname&gt;[:port]
4632N/A</pre>
4632N/A&lt;protocol&gt; is the protocol that should be used to communicate with the
4632N/Aremote
4632N/Aserver; only "http" is supported by this module.
4632N/A
4632N/AExample:
4632N/A<pre>
4632N/A ProxyRemote ftp http://ftpproxy.mydomain.com:8080
4632N/A ProxyRemote http://goodguys.com/ http://mirrorguys.com:8000
4632N/A ProxyRemote * http://cleversite.com
4632N/A</pre>
4632N/A
4632N/A<A name="proxypass"><h2>ProxyPass</h2></A>
4632N/A<strong>Syntax:</strong> ProxyPass <em>&lt;path&gt; &lt;url&gt;</em><br>
4632N/A<strong>Context:</strong> server config<br>
4632N/A<strong>Status:</strong> Base<br>
4632N/A<strong>Module:</strong> mod_proxy<br>
4632N/A<strong>Compatibility:</strong> ProxyPass is only available in
4632N/AApache 1.1 and later.<p>
4632N/A
4632N/AThis directive allows remote servers to be mapped into the space of the local
4632N/Aserver; the local server does not act as a proxy in the conventional sense,
4632N/Abut appears to be a mirror of the remote server. &lt;path&gt; is the name of
4632N/Aa local virtual path; &lt;url&gt; is a partial URL for the remote server.
4632N/A
4632N/ASuppose the local server has address http://wibble.org; then
4632N/A<pre>
4632N/A ProxyPass /mirror/foo http://foo.com
4632N/A</pre>
4632N/AWill cause a local request for the http://wibble.org/mirror/foo/bar to be
4632N/Ainternally converted into a proxy request to http://foo.com/bar
4632N/A
4632N/A<A name="cacheroot"><h2>CacheRoot</h2></A>
4632N/A<strong>Syntax:</strong> CacheRoot <em>&lt;directory&gt;</em><br>
4632N/A<strong>Context:</strong> server config<br>
4632N/A<strong>Status:</strong> Base<br>
4632N/A<strong>Module:</strong> mod_proxy<br>
4632N/A<strong>Compatibility:</strong> CacheRoot is only available in
4632N/AApache 1.1 and later.<p>
4632N/A
4632N/ASets the name of the directory to contain cache files; this must be
4632N/Awritable
4632N/Aby the httpd server.
4632N/A
4632N/A<A name="cachesize"><h2>CacheSize</h2></A>
4632N/A<strong>Syntax:</strong> CacheSize <em>&lt;size&gt;</em><br>
4632N/A<strong>Default:</strong> <code>CacheSize 5</code><br>
4632N/A<strong>Context:</strong> server config<br>
4632N/A<strong>Status:</strong> Base<br>
4632N/A<strong>Module:</strong> mod_proxy<br>
4632N/A<strong>Compatibility:</strong> CacheSize is only available in
4632N/AApache 1.1 and later.<p>
4632N/A
4632N/ASets the desired space usage of the cache, in Kb (1024 byte units). Although
4632N/Ausage may grow above this setting, the garbage collection will delete files
until the usage is at or below this setting.
<A name="cachegcinterval"><h2>CacheGcInterval</h2></A>
<strong>Syntax:</strong> CacheGcInterval <em>&lt;time&gt;</em><br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_proxy<br>
<strong>Compatibility:</strong> CacheGcinterval is only available in
Apache 1.1 and later.<p>
Check the cache every &lt;time&gt; hours, and delete files if the space
usage is greater than that set by CacheSize.
<A name="cachemaxexpire"><h2>CacheMaxExpire</h2></A>
<strong>Syntax:</strong> CacheMaxExpire <em>&lt;time&gt;</em><br>
<strong>Default:</strong> </code>CacheMaxExpire 24</code><br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_proxy<br>
<strong>Compatibility:</strong> CacheMaxExpire is only available in
Apache 1.1 and later.<p>
Cachable HTTP documents will be retained for at most &lt;time&gt; hours without
checking the origin server. Thus documents can be at most &lt;time&gt;
hours out of date. This restriction is enforced even if an expiry date
was supplied with the document.
<A name="cachelastmodifiedfactor"><h2>CacheLastModifiedFactor</h2></A>
<strong>Syntax:</strong> CacheLastModifiedFactor <em>&lt;factor&gt;</em><br>
<strong>Default:</strong> </code>CacheLastModifiedFactor 0.1</code><br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_proxy<br>
<strong>Compatibility:</strong> CacheLastModified is only available in
Apache 1.1 and later.<p>
If the origin HTTP server did not supply an expiry date for the
document, then estimate on using the formula
<pre>
expiry-period = time-since-last-modification * &lt;factor&gt;
</pre>
For example, if the document was last modified 10 hours ago, and
&lt;factor&gt; is 0.1, then the expiry period will be set to 10*0.1 = 1 hour.
<p>If the expiry-period would be longer than that set by CacheMaxExpire,
then the latter takes precedence.
<A name="cachedefaultexpire"><h2>CacheDefaultExpire</h2></A>
<strong>Syntax:</strong> CacheDefaultExpire <em>&lt;time&gt;</em><br>
<strong>Default:</strong> </code>CacheDefaultExpire 1</code><br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_proxy<br>
<strong>Compatibility:</strong> CacheDefaultExpire is only available in
Apache 1.1 and later.<p>
If the document is fetched via a protocol that does not support expirytimes,
then use &lt;time&gt; as the expiry time.
<a href="#cachemaxexpire">CacheMaxExpire</a> does <strong>not</strong>
override.
<A name="nocache"><h2>NoCache</h2></A>
<strong>Syntax:</strong> NoCache <em>&lt;host/domain list&gt;</em><br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_proxy<br>
<strong>Compatibility:</strong> NoCache is only available in
Apache 1.1 and later.<p>
The NoCache directive specifies a list of hosts and/or domains, separated
by spaces. HTTP documents from hosts or domains in the list are <em>not</em>
cached by the proxy server. Example:
<pre>
NoCache joes.garage.com some.host.co.uk wotsamattau.edu
</pre>
<!--#include virtual="footer.html" -->
</BODY>
</HTML>