# HG changeset patch # User Ruslan Ermilov # Date 1449871587 -10800 # Node ID 7945dac7ad477bba6b9f1882a6e7455d407da7e9 # Parent d846df055f036d31fa6f8e978dba8dec1d8dde1b Documented multiple limit_req support and inheritance rules. diff -r d846df055f03 -r 7945dac7ad47 xml/en/docs/http/ngx_http_limit_req_module.xml --- a/xml/en/docs/http/ngx_http_limit_req_module.xml Fri Dec 18 11:57:34 2015 +0300 +++ b/xml/en/docs/http/ngx_http_limit_req_module.xml Sat Dec 12 01:06:27 2015 +0300 @@ -10,7 +10,7 @@ + rev="5">
@@ -91,6 +91,31 @@ + +There could be several limit_req 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: + +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; +} + + + + + +These directives are inherited from the previous level if and +only if there are no +limit_req +directives on the current level. + + diff -r d846df055f03 -r 7945dac7ad47 xml/ru/docs/http/ngx_http_limit_req_module.xml --- a/xml/ru/docs/http/ngx_http_limit_req_module.xml Fri Dec 18 11:57:34 2015 +0300 +++ b/xml/ru/docs/http/ngx_http_limit_req_module.xml Sat Dec 12 01:06:27 2015 +0300 @@ -10,7 +10,7 @@ + rev="5">
@@ -91,6 +91,29 @@ + +Директив limit_req может быть несколько. +Например, следующая конфигурация ограничивает скорость обработки запросов, +поступающих с одного IP-адреса, и в то же время ограничивает +скорость обработки запросов одним виртуальным сервером: + +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; +} + + + + + +Директивы наследуются с предыдущего уровня при условии, что на данном уровне +не описаны свои директивы limit_req. + +