Mercurial > hg > nginx-site
annotate xml/en/docs/http/ngx_http_headers_module.xml @ 3099:9cfda14d0109 default tip
freenginx-1.27.4
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 03 Sep 2024 13:15:18 +0300 |
parents | eeed494bba51 |
children |
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 |
580
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
427
diff
changeset
|
3 <!-- |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
427
diff
changeset
|
4 Copyright (C) Igor Sysoev |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
427
diff
changeset
|
5 Copyright (C) Nginx, Inc. |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
427
diff
changeset
|
6 --> |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
427
diff
changeset
|
7 |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
8 <!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
|
9 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
10 <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
|
11 link="/en/docs/http/ngx_http_headers_module.html" |
589 | 12 lang="en" |
2593
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2391
diff
changeset
|
13 rev="13"> |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
14 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
15 <section id="summary"> |
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 <para> |
966 | 18 The <literal>ngx_http_headers_module</literal> module allows adding |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
19 the <header>Expires</header> and <header>Cache-Control</header> header |
966 | 20 fields, and arbitrary fields, to a response header. |
353
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 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
23 </section> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
24 |
364 | 25 |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
26 <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
|
27 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
28 <para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
29 <example> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
30 expires 24h; |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
31 expires modified +24h; |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
32 expires @24h; |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
33 expires 0; |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
34 expires -1; |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
35 expires epoch; |
1375
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
36 expires $expires; |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
37 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
|
38 </example> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
39 </para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
40 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
41 </section> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
42 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
43 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
44 <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
|
45 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
46 <directive name="add_header"> |
1291
d7740f42b00a
Headers: documented the "always" parameter of the "add_header" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1060
diff
changeset
|
47 <syntax> |
d7740f42b00a
Headers: documented the "always" parameter of the "add_header" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1060
diff
changeset
|
48 <value>name</value> <value>value</value> |
d7740f42b00a
Headers: documented the "always" parameter of the "add_header" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1060
diff
changeset
|
49 [<literal>always</literal>]</syntax> |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
50 <default/> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
51 <context>http</context> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
52 <context>server</context> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
53 <context>location</context> |
686
f368bff5c70a
Documented missing contexts in the http_headers module.
Vladimir Homutov <vl@nginx.com>
parents:
589
diff
changeset
|
54 <context>if in location</context> |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
55 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
56 <para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
57 Adds the specified field to a response header provided that |
2039
d2969b2f69ae
Added history notes about codes 201, 307, and 308.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2002
diff
changeset
|
58 the response code equals 200, 201 (1.3.10), 204, 206, 301, 302, 303, 304, |
d2969b2f69ae
Added history notes about codes 201, 307, and 308.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2002
diff
changeset
|
59 307 (1.1.16, 1.0.13), or 308 (1.13.0). |
2391
375a3dfde23b
Unified phrase "Parameter value can contain variables".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2311
diff
changeset
|
60 Parameter value can contain variables. |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
61 </para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
62 |
1060
b841fbb8c577
Clarified add_header inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
966
diff
changeset
|
63 <para> |
b841fbb8c577
Clarified add_header inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
966
diff
changeset
|
64 There could be several <literal>add_header</literal> directives. |
2593
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2391
diff
changeset
|
65 These directives are inherited from the previous configuration level |
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2391
diff
changeset
|
66 if and only if there are no <literal>add_header</literal> directives |
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2391
diff
changeset
|
67 defined on the current level. |
1060
b841fbb8c577
Clarified add_header inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
966
diff
changeset
|
68 </para> |
b841fbb8c577
Clarified add_header inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
966
diff
changeset
|
69 |
1291
d7740f42b00a
Headers: documented the "always" parameter of the "add_header" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1060
diff
changeset
|
70 <para> |
d7740f42b00a
Headers: documented the "always" parameter of the "add_header" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1060
diff
changeset
|
71 If the <literal>always</literal> parameter is specified (1.7.5), |
d7740f42b00a
Headers: documented the "always" parameter of the "add_header" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1060
diff
changeset
|
72 the header field will be added regardless of the response code. |
d7740f42b00a
Headers: documented the "always" parameter of the "add_header" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1060
diff
changeset
|
73 </para> |
d7740f42b00a
Headers: documented the "always" parameter of the "add_header" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1060
diff
changeset
|
74 |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
75 </directive> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
76 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
77 |
2002
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
78 <directive name="add_trailer"> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
79 <syntax> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
80 <value>name</value> <value>value</value> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
81 [<literal>always</literal>]</syntax> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
82 <default/> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
83 <context>http</context> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
84 <context>server</context> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
85 <context>location</context> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
86 <context>if in location</context> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
87 <appeared-in>1.13.2</appeared-in> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
88 |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
89 <para> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
90 Adds the specified field to the end of a response provided that |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
91 the response code equals 200, 201, 206, 301, 302, 303, 307, or 308. |
2391
375a3dfde23b
Unified phrase "Parameter value can contain variables".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2311
diff
changeset
|
92 Parameter value can contain variables. |
2002
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
93 </para> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
94 |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
95 <para> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
96 There could be several <literal>add_trailer</literal> directives. |
2593
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2391
diff
changeset
|
97 These directives are inherited from the previous configuration level |
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2391
diff
changeset
|
98 if and only if there are no <literal>add_trailer</literal> directives |
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2391
diff
changeset
|
99 defined on the current level. |
2002
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
100 </para> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
101 |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
102 <para> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
103 If the <literal>always</literal> parameter is specified |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
104 the specified field will be added regardless of the response code. |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
105 </para> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
106 |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
107 </directive> |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
108 |
e1f0ef8cff5e
Documented the "add_trailer" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2001
diff
changeset
|
109 |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
110 <directive name="expires"> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
111 <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
|
112 <syntax> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
113 <literal>epoch</literal> | |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
114 <literal>max</literal> | |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
115 <literal>off</literal></syntax> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
116 <default>off</default> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
117 <context>http</context> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
118 <context>server</context> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
119 <context>location</context> |
686
f368bff5c70a
Documented missing contexts in the http_headers module.
Vladimir Homutov <vl@nginx.com>
parents:
589
diff
changeset
|
120 <context>if in location</context> |
353
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 <para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
123 Enables or disables adding or modifying the <header>Expires</header> |
770
a879f261f3db
Reduced unnecessary diffs between "add_header" and "expires" texts.
Ruslan Ermilov <ru@nginx.com>
parents:
762
diff
changeset
|
124 and <header>Cache-Control</header> response header fields provided that |
2039
d2969b2f69ae
Added history notes about codes 201, 307, and 308.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2002
diff
changeset
|
125 the response code equals 200, 201 (1.3.10), 204, 206, 301, 302, 303, 304, |
d2969b2f69ae
Added history notes about codes 201, 307, and 308.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2002
diff
changeset
|
126 307 (1.1.16, 1.0.13), or 308 (1.13.0). |
1808
4b6d7686e00f
Corrected articles in the "expires" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1375
diff
changeset
|
127 The parameter can be a positive or negative |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
128 <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
|
129 </para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
130 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
131 <para> |
1808
4b6d7686e00f
Corrected articles in the "expires" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1375
diff
changeset
|
132 The time in the <header>Expires</header> field is computed as a sum of the |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
133 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
|
134 If the <literal>modified</literal> parameter is used (0.7.0, 0.6.32) |
1808
4b6d7686e00f
Corrected articles in the "expires" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1375
diff
changeset
|
135 then the time is computed as a sum of the file’s modification time and |
4b6d7686e00f
Corrected articles in the "expires" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1375
diff
changeset
|
136 the <value>time</value> specified in the directive. |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
137 </para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
138 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
139 <para> |
1808
4b6d7686e00f
Corrected articles in the "expires" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1375
diff
changeset
|
140 In addition, it is possible to specify a time of day using |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
141 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
|
142 <example> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
143 expires @15h30m; |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
144 </example> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
145 </para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
146 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
147 <para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
148 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
|
149 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
|
150 <list type="bullet"> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
151 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
152 <listitem> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
153 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
|
154 </listitem> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
155 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
156 <listitem> |
367
f4033b9bc4ec
- Removed unnecessary instances of unbreakable space.
Ruslan Ermilov <ru@nginx.com>
parents:
364
diff
changeset
|
157 time is positive or zero — |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
158 <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
|
159 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
|
160 </listitem> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
161 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
162 </list> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
163 </para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
164 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
165 <para> |
2311
6ca49554d5fe
Documented how "expires epoch" affects Cache-Control.
Ruslan Ermilov <ru@nginx.com>
parents:
2039
diff
changeset
|
166 The <literal>epoch</literal> parameter sets <header>Expires</header> |
6ca49554d5fe
Documented how "expires epoch" affects Cache-Control.
Ruslan Ermilov <ru@nginx.com>
parents:
2039
diff
changeset
|
167 to the value “<literal>Thu, 01 Jan 1970 00:00:01 GMT</literal>”, |
6ca49554d5fe
Documented how "expires epoch" affects Cache-Control.
Ruslan Ermilov <ru@nginx.com>
parents:
2039
diff
changeset
|
168 and <header>Cache-Control</header> to “<literal>no-cache</literal>”. |
6ca49554d5fe
Documented how "expires epoch" affects Cache-Control.
Ruslan Ermilov <ru@nginx.com>
parents:
2039
diff
changeset
|
169 </para> |
6ca49554d5fe
Documented how "expires epoch" affects Cache-Control.
Ruslan Ermilov <ru@nginx.com>
parents:
2039
diff
changeset
|
170 |
6ca49554d5fe
Documented how "expires epoch" affects Cache-Control.
Ruslan Ermilov <ru@nginx.com>
parents:
2039
diff
changeset
|
171 <para> |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
172 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
|
173 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
|
174 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
|
175 </para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
176 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
177 <para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
178 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
|
179 <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
|
180 header fields. |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
181 </para> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
182 |
1375
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
183 <para> |
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
184 The last parameter value can contain variables (1.7.9): |
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
185 <example> |
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
186 map $sent_http_content_type $expires { |
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
187 default off; |
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
188 application/pdf 42d; |
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
189 ~image/ max; |
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
190 } |
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
191 |
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
192 expires $expires; |
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
193 </example> |
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
194 </para> |
ab0ebdd7ddac
Documented variables support in the expires directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1291
diff
changeset
|
195 |
353
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
196 </directive> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
197 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
198 </section> |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
199 |
7b6155ac373b
Revised the Russian version of ngx_http_headers_module and translated
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
200 </module> |