annotate 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
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
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
19 <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
20
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
21 <para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
22 <example>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
23 expires 24h;
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
24 expires modified +24h;
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
25 expires @24h;
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
26 expires 0;
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
27 expires -1;
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
28 expires epoch;
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
29 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
30 </example>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
31 </para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
32
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
33 </section>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
34
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 <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
37
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
38 <directive name="add_header">
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
39 <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
40 <default/>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
41 <context>http</context>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
42 <context>server</context>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
43 <context>location</context>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
44
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
45 <para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
46 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
47 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
48 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
49 </para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
50
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
51 </directive>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
52
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 <directive name="expires">
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
55 <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
56 <syntax>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
57 <literal>epoch</literal> |
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
58 <literal>max</literal> |
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
59 <literal>off</literal></syntax>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
60 <default>off</default>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
61 <context>http</context>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
62 <context>server</context>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
63 <context>location</context>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
64
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
65 <para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
66 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
67 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
68 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
69 <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
70 </para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
71
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
72 <para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
73 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
74 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
75 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
76 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
77 <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
78 </para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
79
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
80 <para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
81 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
82 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
83 <example>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
84 expires @15h30m;
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
85 </example>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
86 </para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
87
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
88 <para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
89 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
90 “<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
91 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
92 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
93 <list type="bullet">
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
94
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
95 <listitem>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
96 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
97 </listitem>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
98
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
99 <listitem>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
100 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
101 <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
102 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
103 </listitem>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
104
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
105 </list>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
106 </para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
107
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
108 <para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
109 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
110 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
111 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
112 </para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
113
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
114 <para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
115 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
116 <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
117 header fields.
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
118 </para>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
119
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
120 </directive>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
121
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
122 </section>
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
123
7b6155ac373b Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
124 </module>