changeset 1629:7945dac7ad47

Documented multiple limit_req support and inheritance rules.
author Ruslan Ermilov <ru@nginx.com>
date Sat, 12 Dec 2015 01:06:27 +0300
parents d846df055f03
children 6edda6c6f42f
files xml/en/docs/http/ngx_http_limit_req_module.xml xml/ru/docs/http/ngx_http_limit_req_module.xml
diffstat 2 files changed, 50 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_limit_req_module.xml
+++ b/xml/en/docs/http/ngx_http_limit_req_module.xml
@@ -10,7 +10,7 @@
 <module name="Module ngx_http_limit_req_module"
         link="/en/docs/http/ngx_http_limit_req_module.html"
         lang="en"
-        rev="4">
+        rev="5">
 
 <section id="summary">
 
@@ -91,6 +91,31 @@ limit_req zone=one burst=5 nodelay;
 </example>
 </para>
 
+<para>
+There could be several <literal>limit_req</literal> directives.
+For example, the following configuration will limit the processing rate
+of requests coming from a single IP address and, at the same time,
+the request processing rate by the virtual server:
+<example>
+limit_req_zone $binary_remote_addr zone=perip:10m rate=1r/s;
+limit_req_zone $server_name zone=perserver:10m rate=10r/s;
+
+server {
+    ...
+    limit_req zone=perip burst=5 nodelay;
+    limit_req zone=perserver burst=10;
+}
+</example>
+
+</para>
+
+<para>
+These directives are inherited from the previous level if and
+only if there are no
+<literal>limit_req</literal>
+directives on the current level.
+</para>
+
 </directive>
 
 
--- a/xml/ru/docs/http/ngx_http_limit_req_module.xml
+++ b/xml/ru/docs/http/ngx_http_limit_req_module.xml
@@ -10,7 +10,7 @@
 <module name="Модуль ngx_http_limit_req_module"
         link="/ru/docs/http/ngx_http_limit_req_module.html"
         lang="ru"
-        rev="4">
+        rev="5">
 
 <section id="summary">
 
@@ -91,6 +91,29 @@ limit_req zone=one burst=5 nodelay;
 </example>
 </para>
 
+<para>
+Директив <literal>limit_req</literal> может быть несколько.
+Например, следующая конфигурация ограничивает скорость обработки запросов,
+поступающих с одного IP-адреса, и в то же время ограничивает
+скорость обработки запросов одним виртуальным сервером:
+<example>
+limit_req_zone $binary_remote_addr zone=perip:10m rate=1r/s;
+limit_req_zone $server_name zone=perserver:10m rate=10r/s;
+
+server {
+    ...
+    limit_req zone=perip burst=5 nodelay;
+    limit_req zone=perserver burst=10;
+}
+</example>
+
+</para>
+
+<para>
+Директивы наследуются с предыдущего уровня при условии, что на данном уровне
+не описаны свои директивы <literal>limit_req</literal>.
+</para>
+
 </directive>