annotate xml/en/docs/http/ngx_http_headers_module.xml @ 364:bb51d3e17dd0

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