changeset 2016:e6de97d14f81

Documented the mirror module.
author Yaroslav Zhuravlev <yar@nginx.com>
date Fri, 04 Aug 2017 18:24:38 +0300
parents 75cb57264e52
children a1f1c21cc19d
files xml/en/GNUmakefile xml/en/docs/http/ngx_http_mirror_module.xml xml/en/docs/index.xml xml/ru/GNUmakefile xml/ru/docs/http/ngx_http_mirror_module.xml xml/ru/docs/index.xml
diffstat 6 files changed, 217 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/xml/en/GNUmakefile	Tue Aug 08 17:05:35 2017 +0300
+++ b/xml/en/GNUmakefile	Fri Aug 04 18:24:38 2017 +0300
@@ -66,6 +66,7 @@
 		http/ngx_http_log_module				\
 		http/ngx_http_map_module				\
 		http/ngx_http_memcached_module				\
+		http/ngx_http_mirror_module				\
 		http/ngx_http_mp4_module				\
 		http/ngx_http_perl_module				\
 		http/ngx_http_proxy_module				\
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xml/en/docs/http/ngx_http_mirror_module.xml	Fri Aug 04 18:24:38 2017 +0300
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+
+<!--
+  Copyright (C) Nginx, Inc.
+  -->
+
+<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
+
+<module name="Module ngx_http_mirror_module"
+        link="/en/docs/http/ngx_http_mirror_module.html"
+        lang="en"
+        rev="1">
+
+<section id="summary">
+
+<para>
+The <literal>ngx_http_mirror_module</literal> module (1.13.4) implements
+mirroring of an original request
+by creating background mirror subrequests.
+The output of mirror subrequests is ignored.
+</para>
+
+</section>
+
+
+<section id="example" name="Example Configuration">
+
+<para>
+<example>
+location / {
+    mirror /mirror;
+    proxy_pass http://backend;
+}
+
+location /mirror {
+    internal;
+    proxy_pass http://test_backend$request_uri;
+}
+</example>
+</para>
+
+</section>
+
+
+<section id="directives" name="Directives">
+
+<directive name="mirror">
+<syntax><value>uri</value> | <literal>off</literal></syntax>
+<default>off</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Sets the URI to which an original request will be mirrored.
+Several mirrors can be specified on the same level.
+</para>
+
+</directive>
+
+
+<directive name="mirror_request_body">
+<syntax><literal>on</literal> | <literal>off</literal></syntax>
+<default>on</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Indicates whether the client request body is mirrored.
+When enabled, the client request body will be read
+prior to creating mirror subrequests.
+In this case, unbuffered client request body proxying
+set by
+<link doc="ngx_http_proxy_module.xml" id="proxy_request_buffering">proxy_request_bufferning</link>,
+<link doc="ngx_http_fastcgi_module.xml" id="fastcgi_request_buffering">fastcgi_request_bufferning</link>,
+<link doc="ngx_http_scgi_module.xml" id="scgi_request_buffering">scgi_request_bufferning</link>,
+and
+<link doc="ngx_http_uwsgi_module.xml" id="uwsgi_request_buffering">uwsgi_request_bufferning</link>
+directives will be disabled.
+<example>
+location / {
+    mirror /mirror;
+    mirror_request_body off;
+    proxy_pass http://backend;
+}
+
+location /mirror {
+    internal;
+    proxy_pass http://log_backend;
+    proxy_pass_request_body off;
+    proxy_set_header Content-Length "";
+    proxy_set_header X-Original-URI $request_uri;
+}
+</example>
+</para>
+
+</directive>
+
+</section>
+
+</module>
--- a/xml/en/docs/index.xml	Tue Aug 08 17:05:35 2017 +0300
+++ b/xml/en/docs/index.xml	Fri Aug 04 18:24:38 2017 +0300
@@ -8,7 +8,7 @@
 <article name="nginx documentation"
          link="/en/docs/"
          lang="en"
-         rev="39"
+         rev="40"
          toc="no">
 
 
@@ -345,6 +345,11 @@
 </listitem>
 
 <listitem>
+<link doc="http/ngx_http_mirror_module.xml">
+ngx_http_mirror_module</link>
+</listitem>
+
+<listitem>
 <link doc="http/ngx_http_mp4_module.xml">
 ngx_http_mp4_module</link>
 </listitem>
--- a/xml/ru/GNUmakefile	Tue Aug 08 17:05:35 2017 +0300
+++ b/xml/ru/GNUmakefile	Fri Aug 04 18:24:38 2017 +0300
@@ -56,6 +56,7 @@
 		http/ngx_http_log_module				\
 		http/ngx_http_map_module				\
 		http/ngx_http_memcached_module				\
+		http/ngx_http_mirror_module				\
 		http/ngx_http_mp4_module				\
 		http/ngx_http_perl_module				\
 		http/ngx_http_proxy_module				\
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xml/ru/docs/http/ngx_http_mirror_module.xml	Fri Aug 04 18:24:38 2017 +0300
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+
+<!--
+  Copyright (C) Nginx, Inc.
+  -->
+
+<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
+
+<module name="Модуль ngx_http_mirror_module"
+        link="/ru/docs/http/ngx_http_mirror_module.html"
+        lang="ru"
+        rev="1">
+
+<section id="summary">
+
+<para>
+Модуль <literal>ngx_http_mirror_module</literal> (1.13.4) позволяет
+зеркалировать исходный запрос
+при помощи создания фоновых зеркалирующих подзапросов.
+Результат зеркалирующих подзапросов игнорируется.
+</para>
+
+</section>
+
+
+<section id="example" name="Пример конфигурации">
+
+<para>
+<example>
+location / {
+    mirror /mirror;
+    proxy_pass http://backend;
+}
+
+location /mirror {
+    internal;
+    proxy_pass http://test_backend$request_uri;
+}
+</example>
+</para>
+
+</section>
+
+
+<section id="directives" name="Директивы">
+
+<directive name="mirror">
+<syntax><value>uri</value> | <literal>off</literal></syntax>
+<default>off</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Задаёт URI, на который будет зеркалироваться исходный запрос.
+На одном уровне может использоваться несколько зеркал.
+</para>
+
+</directive>
+
+
+<directive name="mirror_request_body">
+<syntax><literal>on</literal> | <literal>off</literal></syntax>
+<default>on</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Позволяет зеркалировать исходное тело запроса.
+Если включено, то тело запроса клиента будет прочитано
+перед созданием зеркалирующих подзапросов.
+В этом случае будет отключено
+небуферизованное проксирование тела запроса клиента, задаваемое директивами
+<link doc="ngx_http_proxy_module.xml" id="proxy_request_buffering">proxy_request_bufferning</link>,
+<link doc="ngx_http_fastcgi_module.xml" id="fastcgi_request_buffering">fastcgi_request_bufferning</link>,
+<link doc="ngx_http_scgi_module.xml" id="scgi_request_buffering">scgi_request_bufferning</link>

+<link doc="ngx_http_uwsgi_module.xml" id="uwsgi_request_buffering">uwsgi_request_bufferning</link>.
+<example>
+location / {
+    mirror /mirror;
+    mirror_request_body off;
+    proxy_pass http://backend;
+}
+
+location /mirror {
+    internal;
+    proxy_pass http://log_backend;
+    proxy_pass_request_body off;
+    proxy_set_header Content-Length "";
+    proxy_set_header X-Original-URI $request_uri;
+}
+</example>
+</para>
+
+</directive>
+
+</section>
+
+</module>
--- a/xml/ru/docs/index.xml	Tue Aug 08 17:05:35 2017 +0300
+++ b/xml/ru/docs/index.xml	Fri Aug 04 18:24:38 2017 +0300
@@ -8,7 +8,7 @@
 <article name="nginx: документация"
          link="/ru/docs/"
          lang="ru"
-         rev="39"
+         rev="40"
          toc="no">
 
 
@@ -345,6 +345,11 @@
 </listitem>
 
 <listitem>
+<link doc="http/ngx_http_mirror_module.xml">
+ngx_http_mirror_module</link>
+</listitem>
+
+<listitem>
 <link doc="http/ngx_http_mp4_module.xml">
 ngx_http_mp4_module</link>
 </listitem>