changeset 506:657848837328

Documented how nginx processes proxied server's response header fields (X-Accel-*, Expires, Cache-Control, Set-Cookie) that can be ignored.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 24 Apr 2012 07:32:41 +0000
parents 837bcf62b628
children d00a4f9b1c5d
files xml/en/docs/http/ngx_http_charset_module.xml xml/en/docs/http/ngx_http_core_module.xml xml/en/docs/http/ngx_http_fastcgi_module.xml xml/en/docs/http/ngx_http_proxy_module.xml xml/ru/docs/http/ngx_http_charset_module.xml xml/ru/docs/http/ngx_http_core_module.xml xml/ru/docs/http/ngx_http_fastcgi_module.xml xml/ru/docs/http/ngx_http_proxy_module.xml
diffstat 8 files changed, 270 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_charset_module.xml	Tue Apr 24 07:24:22 2012 +0000
+++ b/xml/en/docs/http/ngx_http_charset_module.xml	Tue Apr 24 07:32:41 2012 +0000
@@ -89,6 +89,16 @@
 </example>
 </para>
 
+<para>
+In addition, charset can also be set in the
+<header>X-Accel-Charset</header> response header field.
+This ability can be disabled using the
+<link doc="ngx_http_proxy_module.xml" id="proxy_ignore_headers"/>
+and
+<link doc="ngx_http_fastcgi_module.xml" id="fastcgi_ignore_headers"/>
+directives.
+</para>
+
 </directive>
 
 
--- a/xml/en/docs/http/ngx_http_core_module.xml	Tue Apr 24 07:24:22 2012 +0000
+++ b/xml/en/docs/http/ngx_http_core_module.xml	Tue Apr 24 07:32:41 2012 +0000
@@ -923,6 +923,16 @@
 </example>
 </para>
 
+<para>
+In addition, rate limit can also be set in the
+<header>X-Accel-Limit-Rate</header> response header field.
+This ability can be disabled using the
+<link doc="ngx_http_proxy_module.xml" id="proxy_ignore_headers"/>
+and
+<link doc="ngx_http_fastcgi_module.xml" id="fastcgi_ignore_headers"/>
+directives.
+</para>
+
 </directive>
 
 
--- a/xml/en/docs/http/ngx_http_fastcgi_module.xml	Tue Apr 24 07:24:22 2012 +0000
+++ b/xml/en/docs/http/ngx_http_fastcgi_module.xml	Tue Apr 24 07:32:41 2012 +0000
@@ -333,6 +333,24 @@
 </example>
 </para>
 
+<para>
+Parameters of caching can also be set directly
+in the response header.
+This has a higher precedence than setting of caching time using the directive.
+The <header>X-Accel-Expires</header> header field sets caching time of a
+response in seconds.
+The value 0 disables to cache a response.
+If a value starts with the prefix <literal>@</literal>, it sets an absolute
+time in seconds since Epoch, up to which the response may be cached.
+If header does not include the <header>X-Accel-Expires</header> field,
+parameters of caching may be set in the header fields
+<header>Expires</header> or <header>Cache-Control</header>.
+If a header includes the <header>Set-Cookie</header> field, such a
+response will not be cached.
+Processing of one or more of these response header fields can be disabled
+using the <link id="fastcgi_ignore_headers"/> directive.
+</para>
+
 </directive>
 
 
@@ -404,6 +422,42 @@
 <header>Cache-Control</header>, and <header>Set-Cookie</header> (0.8.44).
 </para>
 
+<para>
+If not disabled, processing of these header fields has the following effect:
+<list type="bullet" compact="no">
+
+<listitem>
+<header>X-Accel-Expires</header>, <header>Expires</header>,
+<header>Cache-Control</header>, and <header>Set-Cookie</header>
+set parameters of response <link id="fastcgi_cache_valid">caching</link>;
+</listitem>
+
+<listitem>
+<header>X-Accel-Redirect</header> performs an
+<link doc="ngx_http_core_module.xml" id="internal">internal
+redirect</link> to the specified URI;
+</listitem>
+
+<listitem>
+<header>X-Accel-Limit-Rate</header> sets a
+<link doc="ngx_http_core_module.xml" id="limit_rate">rate
+limit</link> for transmission of a response to a client;
+</listitem>
+
+<listitem>
+<header>X-Accel-Buffering</header> enables or disables
+buffering of a response;
+</listitem>
+
+<listitem>
+<header>X-Accel-Charset</header> sets the desired
+<link doc="ngx_http_charset_module.xml" id="charset"/>
+of a response.
+</listitem>
+
+</list>
+</para>
+
 </directive>
 
 
--- a/xml/en/docs/http/ngx_http_proxy_module.xml	Tue Apr 24 07:24:22 2012 +0000
+++ b/xml/en/docs/http/ngx_http_proxy_module.xml	Tue Apr 24 07:32:41 2012 +0000
@@ -82,6 +82,14 @@
 at a time is set by the <link id="proxy_buffer_size"/> directive.
 </para>
 
+<para>
+Buffering can also be enabled or disabled by passing
+“<literal>yes</literal>” or “<literal>no</literal>” in the
+<header>X-Accel-Buffering</header> response header field.
+This ability can be disabled using the
+<link doc="ngx_http_proxy_module.xml" id="proxy_ignore_headers"/> directive.
+</para>
+
 </directive>
 
 
@@ -368,6 +376,24 @@
 </example>
 </para>
 
+<para>
+Parameters of caching can also be set directly
+in the response header.
+This has a higher precedence than setting of caching time using the directive.
+The <header>X-Accel-Expires</header> header field sets caching time of a
+response in seconds.
+The value 0 disables to cache a response.
+If a value starts with the prefix <literal>@</literal>, it sets an absolute
+time in seconds since Epoch, up to which the response may be cached.
+If header does not include the <header>X-Accel-Expires</header> field,
+parameters of caching may be set in the header fields
+<header>Expires</header> or <header>Cache-Control</header>.
+If a header includes the <header>Set-Cookie</header> field, such a
+response will not be cached.
+Processing of one or more of these response header fields can be disabled
+using the <link id="proxy_ignore_headers"/> directive.
+</para>
+
 </directive>
 
 
@@ -596,6 +622,42 @@
 <header>Cache-Control</header>, and <header>Set-Cookie</header> (0.8.44).
 </para>
 
+<para>
+If not disabled, processing of these header fields has the following effect:
+<list type="bullet" compact="no">
+
+<listitem>
+<header>X-Accel-Expires</header>, <header>Expires</header>,
+<header>Cache-Control</header>, and <header>Set-Cookie</header>
+set parameters of response <link id="proxy_cache_valid">caching</link>;
+</listitem>
+
+<listitem>
+<header>X-Accel-Redirect</header> performs an
+<link doc="ngx_http_core_module.xml" id="internal">internal
+redirect</link> to the specified URI;
+</listitem>
+
+<listitem>
+<header>X-Accel-Limit-Rate</header> sets a
+<link doc="ngx_http_core_module.xml" id="limit_rate">rate
+limit</link> for transmission of a response to a client;
+</listitem>
+
+<listitem>
+<header>X-Accel-Buffering</header> enables or disables
+<link id="proxy_buffering">buffering</link> of a response;
+</listitem>
+
+<listitem>
+<header>X-Accel-Charset</header> sets the desired
+<link doc="ngx_http_charset_module.xml" id="charset"/>
+of a response.
+</listitem>
+
+</list>
+</para>
+
 </directive>
 
 
--- a/xml/ru/docs/http/ngx_http_charset_module.xml	Tue Apr 24 07:24:22 2012 +0000
+++ b/xml/ru/docs/http/ngx_http_charset_module.xml	Tue Apr 24 07:32:41 2012 +0000
@@ -89,6 +89,15 @@
 </example>
 </para>
 
+<para>
+Кроме того, кодировка может быть задана в поле <header>X-Accel-Charset</header>
+заголовка ответа.
+Эту возможность можно запретить с помощью директив
+<link doc="ngx_http_proxy_module.xml" id="proxy_ignore_headers"/>

+<link doc="ngx_http_fastcgi_module.xml" id="fastcgi_ignore_headers"/>.
+</para>
+
 </directive>
 
 
--- a/xml/ru/docs/http/ngx_http_core_module.xml	Tue Apr 24 07:24:22 2012 +0000
+++ b/xml/ru/docs/http/ngx_http_core_module.xml	Tue Apr 24 07:32:41 2012 +0000
@@ -905,6 +905,15 @@
 </example>
 </para>
 
+<para>
+Кроме того, ограничение скорости может быть задано в поле
+<header>X-Accel-Limit-Rate</header> заголовка ответа.
+Эту возможность можно запретить с помощью директив
+<link doc="ngx_http_proxy_module.xml" id="proxy_ignore_headers"/>

+<link doc="ngx_http_fastcgi_module.xml" id="fastcgi_ignore_headers"/>.
+</para>
+
 </directive>
 
 
--- a/xml/ru/docs/http/ngx_http_fastcgi_module.xml	Tue Apr 24 07:24:22 2012 +0000
+++ b/xml/ru/docs/http/ngx_http_fastcgi_module.xml	Tue Apr 24 07:32:41 2012 +0000
@@ -331,6 +331,24 @@
 </example>
 </para>
 
+<para>
+Параметры кэширования могут также быть заданы непосредственно
+в заголовке ответа.
+Такой способ приоритетнее, чем задание времени кэширования с помощью директивы.
+Поле заголовка <header>X-Accel-Expires</header> задаёт время кэширования
+ответа в секундах.
+Значение 0 запрещает кэшировать ответ.
+Если значение начинается с префикса <literal>@</literal>, оно задаёт абсолютное
+время в секундах с начала эпохи, до которого ответ может быть закэширован.
+Если в заголовке нет поля <header>X-Accel-Expires</header>,
+параметры кэширования определяются по полям заголовка
+<header>Expires</header> или <header>Cache-Control</header>.
+Ответ, в заголовке которого есть поле <header>Set-Cookie</header>,
+не будет кэшироваться.
+Обработка одного или более из этих полей заголовка может быть отключена
+при помощи директивы <link id="fastcgi_ignore_headers"/>.
+</para>
+
 </directive>
 
 
@@ -400,6 +418,42 @@
 <header>Cache-Control</header> и <header>Set-Cookie</header> (0.8.44).
 </para>
 
+<para>
+Если не запрещено, обработка этих полей заголовка заключается в следующем:
+<list type="bullet" compact="no">
+
+<listitem>
+<header>X-Accel-Expires</header>, <header>Expires</header>,
+<header>Cache-Control</header> и <header>Set-Cookie</header>
+задают параметры <link id="fastcgi_cache_valid">кэширования</link> ответа;
+</listitem>
+
+<listitem>
+<header>X-Accel-Redirect</header> производит
+<link doc="ngx_http_core_module.xml" id="internal">внутреннее
+перенаправление</link> на указанный URI;
+</listitem>
+
+<listitem>
+<header>X-Accel-Limit-Rate</header> задаёт
+<link doc="ngx_http_core_module.xml" id="limit_rate">ограничение
+скорости</link> передачи ответа клиенту;
+</listitem>
+
+<listitem>
+<header>X-Accel-Buffering</header> включает или выключает
+буферизацию ответа;
+</listitem>
+
+<listitem>
+<header>X-Accel-Charset</header> задаёт желаемую
+<link doc="ngx_http_charset_module.xml" id="charset">кодировку</link>
+ответа.
+</listitem>
+
+</list>
+</para>
+
 </directive>
 
 
--- a/xml/ru/docs/http/ngx_http_proxy_module.xml	Tue Apr 24 07:24:22 2012 +0000
+++ b/xml/ru/docs/http/ngx_http_proxy_module.xml	Tue Apr 24 07:32:41 2012 +0000
@@ -81,6 +81,14 @@
 за один раз, задаётся директивой <link id="proxy_buffer_size"/>.
 </para>
 
+<para>
+Буферизация может быть также включена или выключена путём передачи
+значения “<literal>yes</literal>” или “<literal>no</literal>” в поле
+<header>X-Accel-Buffering</header> заголовка ответа.
+Эту возможность можно запретить с помощью директивы
+<link doc="ngx_http_proxy_module.xml" id="proxy_ignore_headers"/>.
+</para>
+
 </directive>
 
 
@@ -367,6 +375,24 @@
 </example>
 </para>
 
+<para>
+Параметры кэширования могут также быть заданы непосредственно
+в заголовке ответа.
+Такой способ приоритетнее, чем задание времени кэширования с помощью директивы.
+Поле заголовка <header>X-Accel-Expires</header> задаёт время кэширования
+ответа в секундах.
+Значение 0 запрещает кэшировать ответ.
+Если значение начинается с префикса <literal>@</literal>, оно задаёт абсолютное
+время в секундах с начала эпохи, до которого ответ может быть закэширован.
+Если в заголовке нет поля <header>X-Accel-Expires</header>,
+параметры кэширования определяются по полям заголовка
+<header>Expires</header> или <header>Cache-Control</header>.
+Ответ, в заголовке которого есть поле <header>Set-Cookie</header>,
+не будет кэшироваться.
+Обработка одного или более из этих полей заголовка может быть отключена
+при помощи директивы <link id="proxy_ignore_headers"/>.
+</para>
+
 </directive>
 
 
@@ -592,6 +618,42 @@
 <header>Cache-Control</header> и <header>Set-Cookie</header> (0.8.44).
 </para>
 
+<para>
+Если не запрещено, обработка этих полей заголовка заключается в следующем:
+<list type="bullet" compact="no">
+
+<listitem>
+<header>X-Accel-Expires</header>, <header>Expires</header>,
+<header>Cache-Control</header> и <header>Set-Cookie</header>
+задают параметры <link id="proxy_cache_valid">кэширования</link> ответа;
+</listitem>
+
+<listitem>
+<header>X-Accel-Redirect</header> производит
+<link doc="ngx_http_core_module.xml" id="internal">внутреннее
+перенаправление</link> на указанный URI;
+</listitem>
+
+<listitem>
+<header>X-Accel-Limit-Rate</header> задаёт
+<link doc="ngx_http_core_module.xml" id="limit_rate">ограничение
+скорости</link> передачи ответа клиенту;
+</listitem>
+
+<listitem>
+<header>X-Accel-Buffering</header> включает или выключает
+<link id="proxy_buffering">буферизацию</link> ответа;
+</listitem>
+
+<listitem>
+<header>X-Accel-Charset</header> задаёт желаемую
+<link doc="ngx_http_charset_module.xml" id="charset">кодировку</link>
+ответа.
+</listitem>
+
+</list>
+</para>
+
 </directive>