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_policy - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.5</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
20 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.5</a> > <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_policy</h1>
24 <p><span>Available Languages: </span><a href="../en/mod/mod_policy.html" title="English"> en </a></p>
26 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>HTTP protocol compliance enforcement.</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>policy_module</td></tr>
29 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_policy.c</td></tr></table>
32 <p>The HTTP protocol recommends that clients should be "liberal in
33 what they accept", and servers "strict with what they send". In some
34 cases it can be difficult to detect when a server or an application
35 has been misconfigured, is serving uncacheable content or is behaving
36 suboptimally, as an HTTP client might be compensating for the server.
37 These problems can potentially lead to excessive bandwidth
38 consumption, or a server outage under load.</p>
40 <p>The <code class="module"><a href="../mod/mod_policy.html">mod_policy</a></code> module consists of a set of
41 filters that test servers for HTTP protocol compliance. These
42 tests allow the server administrator to log violations of, or
43 outright reject responses where certain defined conditions exist.</p>
45 <p>This could be used as a way to set minimum HTTP protocol compliance
46 criteria for a restful application. Alternatively, a reverse proxy or
47 cache could be configured to protect itself from misconfigured origin
48 servers or unexpectedly uncacheable content, or as a mechanism to
49 detect configuration mistakes within the server itself.</p>
52 <div id="quickview"><h3 class="directives">Directives</h3>
54 <li><img alt="" src="../images/down.gif" /> <a href="#policyconditional">PolicyConditional</a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#policyconditionalurl">PolicyConditionalURL</a></li>
56 <li><img alt="" src="../images/down.gif" /> <a href="#policyenvironment">PolicyEnvironment</a></li>
57 <li><img alt="" src="../images/down.gif" /> <a href="#policyfilter">PolicyFilter</a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#policykeepalive">PolicyKeepalive</a></li>
59 <li><img alt="" src="../images/down.gif" /> <a href="#policykeepaliveurl">PolicyKeepaliveURL</a></li>
60 <li><img alt="" src="../images/down.gif" /> <a href="#policylength">PolicyLength</a></li>
61 <li><img alt="" src="../images/down.gif" /> <a href="#policylengthurl">PolicyLengthURL</a></li>
62 <li><img alt="" src="../images/down.gif" /> <a href="#policymaxage">PolicyMaxage</a></li>
63 <li><img alt="" src="../images/down.gif" /> <a href="#policymaxageurl">PolicyMaxageURL</a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#policynocache">PolicyNocache</a></li>
65 <li><img alt="" src="../images/down.gif" /> <a href="#policynocacheurl">PolicyNocacheURL</a></li>
66 <li><img alt="" src="../images/down.gif" /> <a href="#policytype">PolicyType</a></li>
67 <li><img alt="" src="../images/down.gif" /> <a href="#policytypeurl">PolicyTypeURL</a></li>
68 <li><img alt="" src="../images/down.gif" /> <a href="#policyvalidation">PolicyValidation</a></li>
69 <li><img alt="" src="../images/down.gif" /> <a href="#policyvalidationurl">PolicyValidationURL</a></li>
70 <li><img alt="" src="../images/down.gif" /> <a href="#policyvary">PolicyVary</a></li>
71 <li><img alt="" src="../images/down.gif" /> <a href="#policyvaryurl">PolicyVaryURL</a></li>
72 <li><img alt="" src="../images/down.gif" /> <a href="#policyversion">PolicyVersion</a></li>
73 <li><img alt="" src="../images/down.gif" /> <a href="#policyversionurl">PolicyVersionURL</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#actions">Actions</a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#tests">Policy Tests</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#example">Example Configuration</a></li>
80 </ul><h3>See also</h3>
82 <li><a href="../filter.html">Filters</a></li>
83 <li><a href="../compliance.html">HTTP Protocol Compliance</a></li>
85 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
87 <h2><a name="actions" id="actions">Actions</a></h2>
90 <p>If a policy is violated, one of the following actions can be
94 <dt><strong>ignore</strong></dt>
95 <dd>The policy check will be ignored for the given URL space, even
96 if the filter is present.</dd>
98 <dt><strong>log</strong></dt>
99 <dd>The policy check will be executed, and if a violation is detected
100 a warning will be logged to the server error_log, and a
101 <code>Warning</code> header added to the response for the benefit of
104 <dt><strong>enforce</strong></dt>
105 <dd>The policy check will be executed, and if a violation is detected
106 an error will be logged to the server error_log, a
107 <code>Warning</code> header added to the response, and a <code>502
108 Bad Gateway</code> will be returned to the client. Optional links to
109 explanatory documentation can be added to each error message,
110 detailing the origin of each policy.</dd>
114 <p>It is also possible to selectively disable all policies for a
115 given URL space, should the need arise, using the
116 <code class="directive"><a href="#policyfilter">PolicyFilter</a></code> directive.</p>
118 <p>Alternatively, the
119 <code class="directive"><a href="#policyenvironment">PolicyEnvironment</a></code>
120 directive can be used to specify an environment variable, which if
121 present, will cause the policies to be selectively downgraded or
124 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
125 <div class="section">
126 <h2><a name="tests" id="tests">Policy Tests</a></h2>
129 <p>The following policy filters are available:</p>
132 <dt><strong><a href="../compliance.html#policytype">POLICY_TYPE</a>
133 </strong>: Enforce valid content types</dt>
134 <dd>Content types that are syntactically invalid or blank can be detected
135 and the request rejected. Types can be restricted to a specific list
136 containing optional wildcards ? and *.</dd>
138 <dt><strong><a href="../compliance.html#policylength">POLICY_LENGTH</a>
139 </strong>: Enforce the presence of a Content-Length</dt>
140 <dd>The length of responses can be specified in one of three ways, by
141 specifying an explicit length in advance, using chunked encoding to set
142 the length, or by setting no length at all and terminating the request
143 when complete. The absence of a specific content length can affect the
144 cacheability of the response, and prevents the use of keepalive during
145 HTTP/1.0 requests. This policy enforces the presence of an explicit
146 content length on the response.</dd>
148 <dt><strong><a href="../compliance.html#policykeepalive">POLICY_KEEPALIVE
149 </a></strong>: Enforce the option to keepalive</dt>
150 <dd>Less restrictive than the POLICY_LENGTH test, this policy enforces the
151 possibility that the response can be kept alive. If the response doesn't
152 have a protocol defined zero length, and the response isn't already an
153 error, and the response has neither a Content-Length or is declared
154 HTTP/1.1 and lacks Content-Encoding: chunked, then this response will be
157 <dt><strong><a href="../compliance.html#policyvary">POLICY_VARY</a>
158 </strong>: Enforce the absence of certain headers within Vary headers</dt>
159 <dd>If the Vary header contains any of the headers specified, this policy
160 will reject the request. The typical case is the presence of the User-Agent
161 within Vary, which is likely to cause a denial of service condition to a
164 <dt><strong><a href="../compliance.html#policyvalidation">
165 POLICY_VALIDATION</a></strong>: Enforce the presence of Etag and/or
167 <dd>The ability for a cache to determine whether a cached entity can be
168 refreshed is dependent on whether a valid Etag and/or Last-Modified header
169 is present to revalidate against. The absence of both headers, or the
170 invalid syntax of a header will cause this policy to be rejected.</dd>
172 <dt><strong><a href="../compliance.html#policyconditional">
173 POLICY_CONDITIONAL</a></strong>: Enforce correct operation of conditional
175 <dd>When conditional headers are present in the request, a server should
176 respond with a <code>304 Not Modified</code> or <code>412 Precondition
177 Failed</code> response where appropriate. A server may ignore conditional
178 headers, and this affects the efficiency of the HTTP caching mechanism.
179 This policy rejects requests where a conditional header is present, and
180 a 304 or 412 response code was expected, but a 2xx response was seen
183 <dt><strong><a href="../compliance.html#policynocache">POLICY_NOCACHE</a>
184 </strong>: Enforce cacheable responses</dt>
185 <dd>When a response is encountered that declares itself explicitly
186 uncacheable, the request is rejected. A response is considered
187 uncacheable if it specifies any of the following:
188 <ul><li><code>Cache-Control: no-cache</code></li>
189 <li><code>Pragma: no-cache</code></li>
190 <li><code>Cache-Control: no-store</code></li>
191 <li><code>Cache-Control: private</code></li>
194 <dt><strong><a href="../compliance.html#policymaxage">POLICY_MAXAGE</a>
195 </strong>: Enforce a minimum maxage</dt>
196 <dd>When a response is encountered where the freshness lifetime is less
197 than the given value, or the freshness lifetime is heuristic, the request
198 is rejected. A response is checked in the following order:
199 <ul><li>If <code>s-maxage</code> is present but too small; or</li>
200 <li>If <code>max-age</code> is present but too small; or</li>
201 <li>If <code>Expires</code> is present and invalid; or</li>
202 <li><code>Date</code> is present and invalid; or</li>
203 <li><code>Expires</code> minus Date is too small; or</li>
204 <li>No <code>s-maxage</code>, <code>maxage</code>, or
205 <code>Expires</code>/<code>Date</code> declared at all</li>
208 <dt><strong><a href="../compliance.html#policyversion">POLICY_VERSION</a>
209 </strong>: Enforce a minimum HTTP version within a request</dt>
210 <dd>When a request is encountered with an HTTP version number less than
211 the required minimum version, the request is rejected. The following
212 version numbers are recognised:
213 <ul><li><code>HTTP/1.1</code></li>
214 <li><code>HTTP/1.0</code></li>
215 <li><code>HTTP/0.9</code></li>
220 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
221 <div class="section">
222 <h2><a name="example" id="example">Example Configuration</a></h2>
225 <p>A typical configuration protecting a server serving static content
226 might be as follows:</p>
228 <div class="example"><p><code>
229 <Location /><br />
230 <span class="indent">
231 SetOutputFilter POLICY_TYPE;POLICY_LENGTH;POLICY_KEEPALIVE;POLICY_VARY;POLICY_VALIDATION; \<br />
232 <span class="indent">
233 POLICY_CONDITIONAL;POLICY_NOCACHE;POLICY_MAXAGE;POLICY_VERSION<br />
236 # content type must be present and valid, but can be anything<br />
237 PolicyType enforce */*<br />
239 # reject if no explicitly declared content length<br />
240 PolicyLength enforce<br />
242 # covered by the policy length filter<br />
243 PolicyKeepalive ignore<br />
245 # reject if User-Agent appears within Vary headers<br />
246 PolicyVary enforce User-Agent<br />
248 # we want to enforce validation<br />
249 PolicyValidation enforce<br />
251 # non-functional conditional responses should be rejected<br />
252 PolicyConditional enforce<br />
254 # no-cache responses should be rejected<br />
255 PolicyNocache enforce<br />
257 # maxage must be at least a day<br />
258 PolicyMaxage enforce 86400<br />
260 # request version can be anything<br />
261 PolicyVersion ignore HTTP/1.1<br />
263 </Location><br />
265 # suppress policy protection for server-status<br />
266 <Location /server-status><br />
267 <span class="indent">
268 PolicyFilter off<br />
270 </Location><br />
274 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
275 <div class="directive-section"><h2><a name="PolicyConditional" id="PolicyConditional">PolicyConditional</a> <a name="policyconditional" id="policyconditional">Directive</a></h2>
276 <table class="directive">
277 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable the conditional request policy.</td></tr>
278 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyConditional <var>ignore|log|enforce</var></code></td></tr>
279 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ignore</code></td></tr>
280 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
281 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
282 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
283 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyConditional is only available in Apache 2.5.0 and
286 <p>When logged or enforced, a response that should have been conditional
287 but wasn't will be rejected.</p>
289 <div class="example"><h3>Example</h3><p><code>
290 # non-functional conditional responses should be rejected<br />
291 PolicyConditional enforce<br />
295 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
296 <div class="directive-section"><h2><a name="PolicyConditionalURL" id="PolicyConditionalURL">PolicyConditionalURL</a> <a name="policyconditionalurl" id="policyconditionalurl">Directive</a></h2>
297 <table class="directive">
298 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>URL describing the conditional request policy.</td></tr>
299 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyConditionalURL <var>url</var></code></td></tr>
300 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
301 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
302 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
303 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
304 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyConditionalURL is only available in Apache 2.5.0 and
307 <p>Specify the URL of the documentation describing the conditional
308 request policy, to appear within error messages.</p>
311 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
312 <div class="directive-section"><h2><a name="PolicyEnvironment" id="PolicyEnvironment">PolicyEnvironment</a> <a name="policyenvironment" id="policyenvironment">Directive</a></h2>
313 <table class="directive">
314 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Override policies based on an environment variable.</td></tr>
315 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyEnvironment <var>variable</var> <var>log-value</var> <var>ignore-value</var></code></td></tr>
316 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
317 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
318 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
319 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
320 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyEnvironment is only available in Apache 2.5.0 and
323 <p>Downgrade policies to logging only or ignored based on the presence
324 of an environment variable. If the given variable is present and equal
325 to the log-value, enforced policies will be logged instead. If the given
326 variable is present and equal to the ignore-value, all policies will
329 <div class="example"><h3>Example</h3><p><code>
330 # downgrade if POLICY_CONTROL was present<br />
331 PolicyEnvironment POLICY_CONTROL log ignore<br />
335 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
336 <div class="directive-section"><h2><a name="PolicyFilter" id="PolicyFilter">PolicyFilter</a> <a name="policyfilter" id="policyfilter">Directive</a></h2>
337 <table class="directive">
338 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable or disable policies for the given URL space.</td></tr>
339 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyFilter <var>on|off</var></code></td></tr>
340 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>on</code></td></tr>
341 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
342 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
343 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
344 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyFilter is only available in Apache 2.5.0 and
347 <p>Master switch to enable or disable policies for a given URL space.</p>
349 <div class="example"><h3>Example</h3><p><code>
350 # enabled by default<br />
351 <Location /><br />
352 <span class="indent">
353 PolicyFilter on<br />
355 </Location><br />
357 # suppress policy protection for server-status<br />
358 <Location /server-status><br />
359 <span class="indent">
360 PolicyFilter off<br />
362 </Location><br />
366 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
367 <div class="directive-section"><h2><a name="PolicyKeepalive" id="PolicyKeepalive">PolicyKeepalive</a> <a name="policykeepalive" id="policykeepalive">Directive</a></h2>
368 <table class="directive">
369 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable the keepalive policy.</td></tr>
370 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyKeepalive <var>ignore|log|enforce</var></code></td></tr>
371 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ignore</code></td></tr>
372 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
373 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
374 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
375 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyKeepalive is only available in Apache 2.5.0 and
378 <p>When logged or enforced, a response that lacks both an explicit
379 <code>Content-Length</code> header and a <code>Transfer-Encoding</code>
380 of <code>chunked</code> will be rejected.</p>
382 <div class="example"><h3>Example</h3><p><code>
383 # missing Content-Length or Transfer-Encoding should be rejected<br />
384 PolicyKeepalive enforce<br />
388 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
389 <div class="directive-section"><h2><a name="PolicyKeepaliveURL" id="PolicyKeepaliveURL">PolicyKeepaliveURL</a> <a name="policykeepaliveurl" id="policykeepaliveurl">Directive</a></h2>
390 <table class="directive">
391 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>URL describing the keepalive policy.</td></tr>
392 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyKeepaliveURL <var>url</var></code></td></tr>
393 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
394 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
395 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
396 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
397 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyKeepaliveURL is only available in Apache 2.5.0 and
400 <p>Specify the URL of the documentation describing the keepalive
401 policy, to appear within error messages.</p>
404 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
405 <div class="directive-section"><h2><a name="PolicyLength" id="PolicyLength">PolicyLength</a> <a name="policylength" id="policylength">Directive</a></h2>
406 <table class="directive">
407 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable the content length policy.</td></tr>
408 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyLength <var>ignore|log|enforce</var></code></td></tr>
409 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ignore</code></td></tr>
410 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
411 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
412 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
413 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyLength is only available in Apache 2.5.0 and
416 <p>When logged or enforced, a response that lacks an explicit
417 <code>Content-Length</code> header will be rejected.</p>
419 <div class="example"><h3>Example</h3><p><code>
420 # missing Content-Length header should be rejected<br />
421 PolicyLength enforce<br />
425 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
426 <div class="directive-section"><h2><a name="PolicyLengthURL" id="PolicyLengthURL">PolicyLengthURL</a> <a name="policylengthurl" id="policylengthurl">Directive</a></h2>
427 <table class="directive">
428 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>URL describing the content length policy.</td></tr>
429 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyLengthURL <var>url</var></code></td></tr>
430 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
431 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
432 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
433 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
434 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyLengthURL is only available in Apache 2.5.0 and
437 <p>Specify the URL of the documentation describing the content length
438 policy, to appear within error messages.</p>
441 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
442 <div class="directive-section"><h2><a name="PolicyMaxage" id="PolicyMaxage">PolicyMaxage</a> <a name="policymaxage" id="policymaxage">Directive</a></h2>
443 <table class="directive">
444 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable the caching minimum max-age policy.</td></tr>
445 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyMaxage <var>ignore|log|enforce</var> <var>age</var></code></td></tr>
446 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ignore</code></td></tr>
447 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
448 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
449 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
450 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyMaxage is only available in Apache 2.5.0 and
453 <p>When logged or enforced, a response that lacks an explicit freshness
454 lifetime defined with <code>max-age</code>, <code>s-maxage</code> or an
455 <code>Expires</code> header, or where the explicit freshness lifetime is
456 smaller than the given value, will be rejected.</p>
458 <div class="example"><h3>Example</h3><p><code>
459 # reject responses with a freshness lifetime shorter than a day<br />
460 PolicyMaxage enforce 86400<br />
465 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
466 <div class="directive-section"><h2><a name="PolicyMaxageURL" id="PolicyMaxageURL">PolicyMaxageURL</a> <a name="policymaxageurl" id="policymaxageurl">Directive</a></h2>
467 <table class="directive">
468 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>URL describing the caching minimum freshness lifetime policy.</td></tr>
469 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyMaxageURL <var>url</var></code></td></tr>
470 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
471 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
472 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
473 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
474 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyMaxageURL is only available in Apache 2.5.0 and
477 <p>Specify the URL of the documentation describing the caching minimum
478 freshness lifetime policy, to appear within error messages.</p>
481 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
482 <div class="directive-section"><h2><a name="PolicyNocache" id="PolicyNocache">PolicyNocache</a> <a name="policynocache" id="policynocache">Directive</a></h2>
483 <table class="directive">
484 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable the caching no-cache policy.</td></tr>
485 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyNocache <var>ignore|log|enforce</var></code></td></tr>
486 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ignore</code></td></tr>
487 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
488 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
489 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
490 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyNocache is only available in Apache 2.5.0 and
493 <p>When logged or enforced, a response that defines itself uncacheable
494 using the <code>Cache-Control</code> or <code>Pragma</code> headers will
497 <div class="example"><h3>Example</h3><p><code>
498 # Cache-Control: no-cache will be rejected<br />
499 PolicyNocache enforce<br />
504 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
505 <div class="directive-section"><h2><a name="PolicyNocacheURL" id="PolicyNocacheURL">PolicyNocacheURL</a> <a name="policynocacheurl" id="policynocacheurl">Directive</a></h2>
506 <table class="directive">
507 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>URL describing the caching no-cache policy.</td></tr>
508 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyNocacheURL <var>url</var></code></td></tr>
509 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
510 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
511 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
512 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
513 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyNocacheURL is only available in Apache 2.5.0 and
516 <p>Specify the URL of the documentation describing the caching no-cache
517 policy, to appear within error messages.</p>
520 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
521 <div class="directive-section"><h2><a name="PolicyType" id="PolicyType">PolicyType</a> <a name="policytype" id="policytype">Directive</a></h2>
522 <table class="directive">
523 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable the content type policy.</td></tr>
524 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyType <var>ignore|log|enforce</var> <var>type</var> [ <var>type</var> [ ... ]]</code></td></tr>
525 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ignore</code></td></tr>
526 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
527 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
528 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
529 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyType is only available in Apache 2.5.0 and
532 <p>When logged or enforced, a response that lacks a <code>Content-Type</code>
533 header, where the <code>Content-Type</code> header is malformed, or where the
534 header does not match the given pattern or patterns will be rejected.</p>
536 <div class="example"><h3>Example</h3><p><code>
537 # enforce json or XML<br />
538 PolicyType enforce application/json text/xml<br />
541 <div class="example"><h3>Example</h3><p><code>
542 # malformed content type should be rejected<br />
543 PolicyType enforce */*<br />
548 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
549 <div class="directive-section"><h2><a name="PolicyTypeURL" id="PolicyTypeURL">PolicyTypeURL</a> <a name="policytypeurl" id="policytypeurl">Directive</a></h2>
550 <table class="directive">
551 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>URL describing the content type policy.</td></tr>
552 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyTypeURL <var>url</var></code></td></tr>
553 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
554 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
555 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
556 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
557 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyTypeURL is only available in Apache 2.5.0 and
560 <p>Specify the URL of the documentation describing the content type
561 policy, to appear within error messages.</p>
564 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
565 <div class="directive-section"><h2><a name="PolicyValidation" id="PolicyValidation">PolicyValidation</a> <a name="policyvalidation" id="policyvalidation">Directive</a></h2>
566 <table class="directive">
567 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable the validation policy.</td></tr>
568 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyValidation <var>ignore|log|enforce</var></code></td></tr>
569 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ignore</code></td></tr>
570 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</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_policy</td></tr>
573 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyValidation is only available in Apache 2.5.0 and
576 <p>When logged or enforced, a response that lacks either a valid
577 <code>ETag</code> header or a <code>Last-Modified</code> header, or where
578 either header is syntactically incorrect, will be rejected.</p>
580 <div class="example"><h3>Example</h3><p><code>
581 # no ETag or Last-Modified will be rejected<br />
582 PolicyValidation enforce<br />
587 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
588 <div class="directive-section"><h2><a name="PolicyValidationURL" id="PolicyValidationURL">PolicyValidationURL</a> <a name="policyvalidationurl" id="policyvalidationurl">Directive</a></h2>
589 <table class="directive">
590 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>URL describing the content type policy.</td></tr>
591 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyValidationURL <var>url</var></code></td></tr>
592 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
593 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
594 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
595 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
596 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyValidationURL is only available in Apache 2.5.0 and
599 <p>Specify the URL of the documentation describing the validation policy, to
600 appear within error messages.</p>
603 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
604 <div class="directive-section"><h2><a name="PolicyVary" id="PolicyVary">PolicyVary</a> <a name="policyvary" id="policyvary">Directive</a></h2>
605 <table class="directive">
606 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable the Vary policy.</td></tr>
607 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyVary <var>ignore|log|enforce</var> <var>header</var> [ <var>header</var> [ ... ]]</code></td></tr>
608 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ignore</code></td></tr>
609 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
610 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
611 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
612 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyVary is only available in Apache 2.5.0 and
615 <p>When logged or enforced, a response that contains a <code>Vary</code>
616 header which in turn contains one of the headers listed, will be
619 <div class="example"><h3>Example</h3><p><code>
620 # reject reponses with "User-Agent" listed in the Vary header<br />
621 PolicyVary enforce User-Agent<br />
626 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
627 <div class="directive-section"><h2><a name="PolicyVaryURL" id="PolicyVaryURL">PolicyVaryURL</a> <a name="policyvaryurl" id="policyvaryurl">Directive</a></h2>
628 <table class="directive">
629 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>URL describing the content type policy.</td></tr>
630 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyVaryURL <var>url</var></code></td></tr>
631 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
632 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
633 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
634 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
635 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyVaryURL is only available in Apache 2.5.0 and
638 <p>Specify the URL of the documentation describing the vary policy, to
639 appear within error messages.</p>
642 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
643 <div class="directive-section"><h2><a name="PolicyVersion" id="PolicyVersion">PolicyVersion</a> <a name="policyversion" id="policyversion">Directive</a></h2>
644 <table class="directive">
645 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable the version policy.</td></tr>
646 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyVersion <var>ignore|log|enforce</var> <var>HTTP/0.9|HTTP/1.0|HTTP/1.1</var></code></td></tr>
647 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ignore</code></td></tr>
648 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
649 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
650 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
651 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyVersion is only available in Apache 2.5.0 and
654 <p>When logged or enforced, a request with a version lower than specified
655 will be rejected.</p>
657 <div class="example"><h3>Example</h3><p><code>
658 # reject requests with an HTTP version older than HTTP/1.1<br />
659 PolicyVersion enforce HTTP/1.1<br />
664 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
665 <div class="directive-section"><h2><a name="PolicyVersionURL" id="PolicyVersionURL">PolicyVersionURL</a> <a name="policyversionurl" id="policyversionurl">Directive</a></h2>
666 <table class="directive">
667 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>URL describing the minimum request HTTP version policy.</td></tr>
668 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PolicyVersionURL <var>url</var></code></td></tr>
669 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>none</code></td></tr>
670 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
671 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
672 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_policy</td></tr>
673 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>PolicyVersionURL is only available in Apache 2.5.0 and
676 <p>Specify the URL of the documentation describing the minimum request
677 HTTP version policy, to appear within error messages.</p>
681 <div class="bottomlang">
682 <p><span>Available Languages: </span><a href="../en/mod/mod_policy.html" title="English"> en </a></p>
683 </div><div id="footer">
684 <p class="apache">Copyright 2011 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
685 <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>