# HG changeset patch # User Ruslan Ermilov # Date 1327497729 0 # Node ID 7b6155ac373b3d0d73dc2fcd5860eada4dd47739 # Parent d0c9b9e436d466bc17247cbba364d976149b92ab Revised the Russian version of ngx_http_headers_module and translated it into English. diff --git a/xml/en/GNUmakefile b/xml/en/GNUmakefile --- a/xml/en/GNUmakefile +++ b/xml/en/GNUmakefile @@ -56,6 +56,7 @@ REFS = \ http/ngx_http_geoip_module \ http/ngx_http_gzip_module \ http/ngx_http_gzip_static_module \ + http/ngx_http_headers_module \ http/ngx_http_image_filter_module \ http/ngx_http_index_module \ http/ngx_http_limit_conn_module \ diff --git a/xml/en/docs/http/ngx_http_headers_module.xml b/xml/en/docs/http/ngx_http_headers_module.xml new file mode 100644 --- /dev/null +++ b/xml/en/docs/http/ngx_http_headers_module.xml @@ -0,0 +1,124 @@ + + + + + + +
+ + +The ngx_http_headers_module module allows to emit +the
Expires
and
Cache-Control
header +fields, and to add arbitrary fields to a response header. +
+ +
+ +
+ + + +expires 24h; +expires modified +24h; +expires @24h; +expires 0; +expires -1; +expires epoch; +add_header Cache-Control private; + + + +
+ + +
+ + +name value + +http +server +location + + +Adds the specified field to a response header provided that +the response code equals 200, 204, 301, 302, or 304. +A value can contain variables. + + + + + + +[modified] time + + epoch | + max | + off +off +http +server +location + + +Enables or disables adding or modifying the
Expires
+and
Cache-Control
response header fields. +A parameter can be a positive or negative +time. +
+ + +A time in the
Expires
field is computed as a sum of the +current time and time specified in the directive. +If the modified parameter is used (0.7.0, 0.6.32) +then time is computed as a sum of the file’s modification time and +time specified in the directive. +
+ + +In addition, it is possible to specify a time of the day using +the “@” prefix (0.7.9, 0.6.34): + +expires @15h30m; + + + + +The epoch parameter corresponds to the absolute time +“Thu, 01 Jan 1970 00:00:01 GMT”. +The contents of the
Cache-Control
field depends +on the sign of the specified time: + + + +time is negative —
Cache-Control: no-cache
. +
+ + +time is positive or zero — +
Cache-Control: max-age=t
, +where t is a time specified in the directive, in seconds. +
+ +
+
+ + +The max parameter sets
Expires
+to the value “Thu, 31 Dec 2037 23:55:55 GMT”, +and
Cache-Control
to 10 years. +
+ + +The off parameter disables adding or modifying the +
Expires
and
Cache-Control
response +header fields. +
+ +
+ +
+ +
diff --git a/xml/en/docs/index.xml b/xml/en/docs/index.xml --- a/xml/en/docs/index.xml +++ b/xml/en/docs/index.xml @@ -130,6 +130,11 @@ ngx_http_gzip_static_module + +ngx_http_headers_module + + + ngx_http_image_filter_module diff --git a/xml/ru/docs/http/ngx_http_headers_module.xml b/xml/ru/docs/http/ngx_http_headers_module.xml --- a/xml/ru/docs/http/ngx_http_headers_module.xml +++ b/xml/ru/docs/http/ngx_http_headers_module.xml @@ -2,45 +2,48 @@ -
-Модуль ngx_http_headers_module позволяет выдавать строки "Expires" -и "Cache-Control" и добавлять произвольные строки в заголовке ответа. +Модуль ngx_http_headers_module позволяет выдавать +поля заголовка
Expires
и
Cache-Control
, +а также добавлять произвольные поля в заголовок ответа.
-
+
- expires 24h; - expires modified +24h; - expires @24h; - expires 0; - expires -1; - expires epoch; - add_header Cache-Control private; +expires 24h; +expires modified +24h; +expires @24h; +expires 0; +expires -1; +expires epoch; +add_header Cache-Control private;
-
+
-название значение +имя значение -http, server, location +http +server +location -Директива добавляет строку в заголовке ответа при условии, что код ответа +Добавляет указанное поле в заголовок ответа при условии, что код ответа равен 200, 204, 301, 302 или 304. В значении можно использовать переменные. @@ -51,59 +54,68 @@ [modified] время - epoch | - max | - off + epoch | + max | + off off -http, server, location +http +server +location -Разрешает или запрещает добавлять или менять строки "Expires" -и "Cache-Control" в заголовке ответа. +Разрешает или запрещает добавлять или менять поля
Expires
Cache-Control
в заголовке ответа. В качестве параметра можно задать положительное или отрицательное время.
-Время в строке "Expires" получается как сумма текущего времени +Время в поле
Expires
получается как сумма текущего времени и времени, заданного в директиве. -Если используется параметр "modified" (0.7.0, 0.6.32), +Если используется параметр modified (0.7.0, 0.6.32), то время получается как сумма времени модификации файла и времени, заданного в директиве.
-Кроме того, с помощью префикса "@" можно задать время суток (0.7.9, 0.6.34): +Кроме того, с помощью префикса “@” можно задать +время суток (0.7.9, 0.6.34): -expires @15h30m; +expires @15h30m; -Параметр "epoch" означает абсолютное время 1 января 1970 года 00:00:01 GMT. -Содержимое строки "Cache-Control" зависит от знака заданного времени: +Параметр epoch соответствует абсолютному времени +“Thu, 01 Jan 1970 00:00:01 GMT” +(1 января 1970 года 00:00:01 GMT). +Содержимое поля
Cache-Control
зависит от знака +заданного времени: -отрицательное время — "Cache-Control: no-cache". +отрицательное время —
Cache-Control: no-cache
.
-положительное время или равное нулю — "Cache-Control: max-age=#", -где "#" - это время в секундах, заданное в директиве. +положительное или равное нулю время — +
Cache-Control: max-age=t
, +где t это время в секундах, заданное в директиве.
-Параметр "max" задаёт время 31 декабря 2037 23:55:55 GMT для строки "Expires" -и 10 лет для строки "Cache-Control". +Параметр max задаёт время +“Thu, 31 Dec 2037 23:55:55 GMT” +(31 декабря 2037 23:55:55 GMT) для поля
Expires
+и 10 лет для поля
Cache-Control
.
-Параметр "off" запрещает добавлять или менять строки "Expires" -и "Cache-Control" в заголовке ответа. +Параметр off запрещает добавлять или менять поля +
Expires
и
Cache-Control
в заголовке ответа.