Mercurial > hg > nginx-site
changeset 1320:f15a983cac66
Limit conn/req: key is no longer limited to only one variable.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Wed, 01 Oct 2014 21:56:23 +0400 |
parents | c365080bd00a |
children | 20eb968adcd8 |
files | xml/en/docs/http/ngx_http_limit_conn_module.xml xml/en/docs/http/ngx_http_limit_req_module.xml xml/ru/docs/http/ngx_http_limit_conn_module.xml xml/ru/docs/http/ngx_http_limit_req_module.xml |
diffstat | 4 files changed, 28 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_limit_conn_module.xml +++ b/xml/en/docs/http/ngx_http_limit_conn_module.xml @@ -10,7 +10,7 @@ <module name="Module ngx_http_limit_conn_module" link="/en/docs/http/ngx_http_limit_conn_module.html" lang="en" - rev="3"> + rev="4"> <section id="summary"> @@ -144,7 +144,7 @@ Sets the status code to return in respon <directive name="limit_conn_zone"> <syntax> - <value>$variable</value> + <value>key</value> <literal>zone</literal>=<value>name</value>:<value>size</value></syntax> <default/> <context>http</context> @@ -153,8 +153,11 @@ Sets the status code to return in respon Sets parameters for a shared memory zone that will keep states for various keys. In particular, the state includes the current number of connections. -The key is any non-empty value of the specified variable -(empty values are not accounted). +The <value>key</value> can contain text, variables, and their combination. +Requests with an empty key value are not accounted. +<note> +Prior to version 1.7.6, a <value>key</value> could contain exactly one variable. +</note> Usage example: <example> limit_conn_zone $binary_remote_addr zone=addr:10m;
--- 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="3"> + rev="4"> <section id="summary"> @@ -136,7 +136,7 @@ Sets the status code to return in respon <directive name="limit_req_zone"> <syntax> - <value>$variable</value> + <value>key</value> <literal>zone</literal>=<value>name</value>:<value>size</value> <literal>rate</literal>=<value>rate</value></syntax> <default/> @@ -146,8 +146,11 @@ Sets the status code to return in respon Sets parameters for a shared memory zone that will keep states for various keys. In particular, the state stores the current number of excessive requests. -The key is any non-empty value of the specified variable -(empty values are not accounted). +The <value>key</value> can contain text, variables, and their combination. +Requests with an empty key value are not accounted. +<note> +Prior to version 1.7.6, a <value>key</value> could contain exactly one variable. +</note> Usage example: <example> limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
--- a/xml/ru/docs/http/ngx_http_limit_conn_module.xml +++ b/xml/ru/docs/http/ngx_http_limit_conn_module.xml @@ -10,7 +10,7 @@ <module name="Модуль ngx_http_limit_conn_module" link="/ru/docs/http/ngx_http_limit_conn_module.html" lang="ru" - rev="3"> + rev="4"> <section id="summary"> @@ -142,7 +142,7 @@ server { <directive name="limit_conn_zone"> <syntax> - <value>$переменная</value> + <value>ключ</value> <literal>zone</literal>=<value>название</value>:<value>размер</value></syntax> <default/> <context>http</context> @@ -151,8 +151,11 @@ server { Задаёт параметры зоны разделяемой памяти, которая хранит состояние для разных значений ключа. Состояние в частности содержит текущее число соединений. -Ключом является любое непустое значение заданной переменной -(пустые значения не учитываются). +В качестве ключа можно использовать текст, переменные и их комбинации. +Запросы с пустым значением ключа не учитываются. +<note> +До версии 1.7.6 в качестве ключа можно было задать ровно одну переменную. +</note> Пример использования: <example> limit_conn_zone $binary_remote_addr zone=addr:10m;
--- 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="3"> + rev="4"> <section id="summary"> @@ -135,7 +135,7 @@ limit_req zone=one burst=5 nodelay; <directive name="limit_req_zone"> <syntax> - <value>$переменная</value> + <value>ключ</value> <literal>zone</literal>=<value>название</value>:<value>размер</value> <literal>rate</literal>=<value>скорость</value></syntax> <default/> @@ -145,8 +145,11 @@ limit_req zone=one burst=5 nodelay; Задаёт параметры зоны разделяемой памяти, которая хранит состояние для разных значений ключа. Состояние в частности хранит текущее число избыточных запросов. -Ключом является любое непустое значение заданной переменной -(пустые значения не учитываются). +В качестве ключа можно использовать текст, переменные и их комбинации. +Запросы с пустым значением ключа не учитываются. +<note> +До версии 1.7.6 в качестве ключа можно было задать ровно одну переменную. +</note> Пример использования: <example> limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;