diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xml/en/docs/http/ngx_http_headers_module.xml	Wed Jan 25 13:22:09 2012 +0000
@@ -0,0 +1,124 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
+
+<module name="Module ngx_http_headers_module"
+        link="/en/docs/http/ngx_http_headers_module.html"
+        lang="en">
+
+<section id="summary">
+
+<para>
+The <literal>ngx_http_headers_module</literal> module allows to emit
+the <header>Expires</header> and <header>Cache-Control</header> header
+fields, and to add arbitrary fields to a response header.
+</para>
+
+</section>
+
+<section id="example" name="Example Configuration">
+
+<para>
+<example>
+expires    24h;
+expires    modified +24h;
+expires    @24h;
+expires    0;
+expires    -1;
+expires    epoch;
+add_header Cache-Control private;
+</example>
+</para>
+
+</section>
+
+
+<section id="directives" name="Directives">
+
+<directive name="add_header">
+<syntax><value>name</value> <value>value</value></syntax>
+<default/>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+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.
+</para>
+
+</directive>
+
+
+<directive name="expires">
+<syntax>[<literal>modified</literal>] <value>time</value></syntax>
+<syntax>
+    <literal>epoch</literal> |
+    <literal>max</literal> |
+    <literal>off</literal></syntax>
+<default>off</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Enables or disables adding or modifying the <header>Expires</header>
+and <header>Cache-Control</header> response header fields.
+A parameter can be a positive or negative
+<link doc="../syntax.xml">time</link>.
+</para>
+
+<para>
+A time in the <header>Expires</header> field is computed as a sum of the
+current time and <value>time</value> specified in the directive.
+If the <literal>modified</literal> parameter is used (0.7.0, 0.6.32)
+then time is computed as a sum of the file’s modification time and
+<value>time</value> specified in the directive.
+</para>
+
+<para>
+In addition, it is possible to specify a time of the day using
+the “<literal>@</literal>” prefix (0.7.9, 0.6.34):
+<example>
+expires @15h30m;
+</example>
+</para>
+
+<para>
+The <literal>epoch</literal> parameter corresponds to the absolute time
+“<literal>Thu, 01 Jan 1970 00:00:01 GMT</literal>”.
+The contents of the <header>Cache-Control</header> field depends
+on the sign of the specified time:
+<list type="bullet">
+
+<listitem>
+time is negative — <header>Cache-Control: no-cache</header>.
+</listitem>
+
+<listitem>
+time is positive or zero —
+<header>Cache-Control: max-age=<value>t</value></header>,
+where <value>t</value> is a time specified in the directive, in seconds.
+</listitem>
+
+</list>
+</para>
+
+<para>
+The <literal>max</literal> parameter sets <header>Expires</header>
+to the value “<literal>Thu, 31 Dec 2037 23:55:55 GMT</literal>”,
+and <header>Cache-Control</header> to 10 years.
+</para>
+
+<para>
+The <literal>off</literal> parameter disables adding or modifying the
+<header>Expires</header> and <header>Cache-Control</header> response
+header fields.
+</para>
+
+</directive>
+
+</section>
+
+</module>