comparison xml/en/docs/http/ngx_http_headers_module.xml @ 353:7b6155ac373b

Revised the Russian version of ngx_http_headers_module and translated it into English.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 25 Jan 2012 13:22:09 +0000
parents
children bb51d3e17dd0
comparison
equal deleted inserted replaced
352:d0c9b9e436d4 353:7b6155ac373b
1 <?xml version="1.0"?>
2
3 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
4
5 <module name="Module ngx_http_headers_module"
6 link="/en/docs/http/ngx_http_headers_module.html"
7 lang="en">
8
9 <section id="summary">
10
11 <para>
12 The <literal>ngx_http_headers_module</literal> module allows to emit
13 the <header>Expires</header> and <header>Cache-Control</header> header
14 fields, and to add arbitrary fields to a response header.
15 </para>
16
17 </section>
18
19 <section id="example" name="Example Configuration">
20
21 <para>
22 <example>
23 expires 24h;
24 expires modified +24h;
25 expires @24h;
26 expires 0;
27 expires -1;
28 expires epoch;
29 add_header Cache-Control private;
30 </example>
31 </para>
32
33 </section>
34
35
36 <section id="directives" name="Directives">
37
38 <directive name="add_header">
39 <syntax><value>name</value> <value>value</value></syntax>
40 <default/>
41 <context>http</context>
42 <context>server</context>
43 <context>location</context>
44
45 <para>
46 Adds the specified field to a response header provided that
47 the response code equals 200, 204, 301, 302, or 304.
48 A value can contain variables.
49 </para>
50
51 </directive>
52
53
54 <directive name="expires">
55 <syntax>[<literal>modified</literal>] <value>time</value></syntax>
56 <syntax>
57 <literal>epoch</literal> |
58 <literal>max</literal> |
59 <literal>off</literal></syntax>
60 <default>off</default>
61 <context>http</context>
62 <context>server</context>
63 <context>location</context>
64
65 <para>
66 Enables or disables adding or modifying the <header>Expires</header>
67 and <header>Cache-Control</header> response header fields.
68 A parameter can be a positive or negative
69 <link doc="../syntax.xml">time</link>.
70 </para>
71
72 <para>
73 A time in the <header>Expires</header> field is computed as a sum of the
74 current time and <value>time</value> specified in the directive.
75 If the <literal>modified</literal> parameter is used (0.7.0, 0.6.32)
76 then time is computed as a sum of the file’s modification time and
77 <value>time</value> specified in the directive.
78 </para>
79
80 <para>
81 In addition, it is possible to specify a time of the day using
82 the “<literal>@</literal>” prefix (0.7.9, 0.6.34):
83 <example>
84 expires @15h30m;
85 </example>
86 </para>
87
88 <para>
89 The <literal>epoch</literal> parameter corresponds to the absolute time
90 “<literal>Thu, 01 Jan 1970 00:00:01 GMT</literal>”.
91 The contents of the <header>Cache-Control</header> field depends
92 on the sign of the specified time:
93 <list type="bullet">
94
95 <listitem>
96 time is negative — <header>Cache-Control: no-cache</header>.
97 </listitem>
98
99 <listitem>
100 time is positive or zero —
101 <header>Cache-Control: max-age=<value>t</value></header>,
102 where <value>t</value> is a time specified in the directive, in seconds.
103 </listitem>
104
105 </list>
106 </para>
107
108 <para>
109 The <literal>max</literal> parameter sets <header>Expires</header>
110 to the value “<literal>Thu, 31 Dec 2037 23:55:55 GMT</literal>”,
111 and <header>Cache-Control</header> to 10 years.
112 </para>
113
114 <para>
115 The <literal>off</literal> parameter disables adding or modifying the
116 <header>Expires</header> and <header>Cache-Control</header> response
117 header fields.
118 </para>
119
120 </directive>
121
122 </section>
123
124 </module>