summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/mod_proxy.html
blob: b64dcd9c6dcac8863b30ad752b82942208b09e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>Apache module mod_proxy</TITLE>
</HEAD>

<BODY>
<IMG SRC="../images/apache_sub.gif" ALT="">
<H1>Apache module mod_proxy</h1>

This module is contained in the <code>mod_proxy.c</code> file, and
is not compiled in by default. It provides for a caching proxy server.
It is only available in Apache 1.1 and later.

<h3>Note:</h3>
<p>This module is experimental. Use at your own risk.</p>

<h2>Summary</h2>

This module implements a proxy/cache for Apache. It implements
proxying capability for 
<code>FTP</code>,
<code>HTTP/0.9</code>, and
<code>HTTP/1.0</code>.
The module can be configured to connect to other proxy modules for these
and other protocols.

<h2>Directives</h2>
<ul>
<li><a href="#proxyrequests">ProxyRequests</a>
<li><a href="#proxyremote">ProxyRemote</a>
<li><a href="#proxypass">ProxyPass</a>
<li><a href="#cacheroot">CacheRoot</a>
<li><a href="#cachesize">CacheSize</a>
<li><a href="#cachegcinterval">CacheGcInterval</a>
<li><a href="#cachemaxexpire">CacheMaxExpire</a>
<li><a href="#cachelastmodifiedfactor">CacheLastModifiedFactor</a>
<li><a href="#cachedefaultexpire">CacheDefaultExpire</a>
<li><a href="#nocache">NoCache</a>
</ul>

<hr>

<A name="proxyrequests"><h2>ProxyRequests</h2></A>
<strong>Syntax:</strong> ProxyRequests <em>on/off</em><br>
<strong>Default:</strong> <code>ProxyRequests Off</code><br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_proxy<br>
<strong>Compatibility:</strong> ProxyRequest is only available in
Apache 1.1 and later.<p>

This allows or prevents Apache from functioning as a proxy
server. Setting ProxyRequests to 'off' does not disable use of the <a
href="#proxypass">ProxyPass</a> directive.

<A name="proxyremote"><h2>ProxyRemote</h2></A>
<strong>Syntax:</strong> ProxyRemote <em>&lt;match&gt; &lt;remote-server&gt;</em><br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_proxy<br>
<strong>Compatibility:</strong> ProxyRemote is only available in
Apache 1.1 and later.<p>

This defines remote proxies to this proxy. &lt;match&gt; is either the
name of a URL-scheme that the remote server supports, or a partial URL
for which the remote server should be used, or '$' to indicate the
server should be contacted for all requests. &lt;remote-server&gt; is a
partial URL for the remote server. Syntax:

<pre>
  &lt;remote-server&gt; = &lt;protocol&gt;://&lt;hostname&gt;[:port]
</pre>
&lt;protocol&gt; is the protocol that should be used to communicate with the
remote
server; only "http" is supported by this module.

Example:
<pre>
  ProxyRemote ftp http://ftpproxy.mydomain.com:8080
  ProxyRemote http://goodguys.com/ http://mirrorguys.com:8000
  ProxyRemote * http://cleversite.com
</pre>

<A name="proxypass"><h2>ProxyPass</h2></A>
<strong>Syntax:</strong> ProxyPass <em>&lt;path&gt; &lt;url&gt;</em><br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_proxy<br>
<strong>Compatibility:</strong> ProxyPass is only available in
Apache 1.1 and later.<p>

This directive allows remote servers to be mapped into the space of the local
server; the local server does not act as a proxy in the conventional sense,
but appears to be a mirror of the remote server. &lt;path&gt; is the name of
a local virtual path; &lt;url&gt; is a partial URL for the remote server.

Suppose the local server has address http://wibble.org; then
<pre>
   ProxyPass /mirror/foo http://foo.com
</pre>
Will cause a local request for the http://wibble.org/mirror/foo/bar to be
internally converted into a proxy request to http://foo.com/bar

<A name="cacheroot"><h2>CacheRoot</h2></A>
<strong>Syntax:</strong> CacheRoot <em>&lt;directory&gt;</em><br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_proxy<br>
<strong>Compatibility:</strong> CacheRoot is only available in
Apache 1.1 and later.<p>

Sets the name of the directory to contain cache files; this must be
writable
by the httpd server.

<A name="cachesize"><h2>CacheSize</h2></A>
<strong>Syntax:</strong> CacheSize <em>&lt;size&gt;</em><br>
<strong>Default:</strong> <code>CacheSize 5</code><br>
<strong>Context:</strong> server config<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_proxy<br>
<strong>Compatibility:</strong> CacheSize is only available in
Apache 1.1 and later.<p>

Sets the desired space usage of the cache, in Kb (1024 byte units). Although
usage 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 wil 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>

<p><hr>

<A HREF="../"><IMG SRC="../images/apache_home.gif" ALT="Home"></A>
<A HREF="./"><IMG SRC="../images/apache_index.gif" ALT="Index"></A>

</BODY>
</HTML>