# HG changeset patch # User Yaroslav Zhuravlev # Date 1467730714 -10800 # Node ID 3d686cb47c2c0f53c55c2904e6b37e8d389c72d0 # Parent c511b73da3a943de6173feaf1b7b9fe733384a4d Documented the map module in stream. diff --git a/xml/en/GNUmakefile b/xml/en/GNUmakefile --- a/xml/en/GNUmakefile +++ b/xml/en/GNUmakefile @@ -97,6 +97,7 @@ REFS = \ stream/ngx_stream_access_module \ stream/ngx_stream_core_module \ stream/ngx_stream_limit_conn_module \ + stream/ngx_stream_map_module \ stream/ngx_stream_proxy_module \ stream/ngx_stream_ssl_module \ stream/ngx_stream_upstream_module \ diff --git a/xml/en/docs/index.xml b/xml/en/docs/index.xml --- a/xml/en/docs/index.xml +++ b/xml/en/docs/index.xml @@ -8,7 +8,7 @@
@@ -497,6 +497,11 @@ ngx_stream_limit_conn_module + +ngx_stream_map_module + + + ngx_stream_proxy_module diff --git a/xml/en/docs/http/ngx_http_map_module.xml b/xml/en/docs/stream/ngx_stream_map_module.xml copy from xml/en/docs/http/ngx_http_map_module.xml copy to xml/en/docs/stream/ngx_stream_map_module.xml --- a/xml/en/docs/http/ngx_http_map_module.xml +++ b/xml/en/docs/stream/ngx_stream_map_module.xml @@ -7,15 +7,15 @@ - + rev="1">
-The ngx_http_map_module module creates variables +The ngx_stream_map_module module (1.11.2) creates variables whose values depend on values of other variables. @@ -26,23 +26,13 @@ whose values depend on values of other v -map $http_host $name { - hostnames; - - default 0; - - example.com 1; - *.example.com 1; - example.org 2; - *.example.org 2; - .example.net 3; - wap.* 4; +map $remote_addr $limit { + 127.0.0.1 ""; + default $binary_remote_addr; } -map $http_user_agent $mobile { - default 0; - "~Opera Mini" 1; -} +limit_conn_zone $limit zone=addr:10m; +limit_conn addr 1; @@ -56,23 +46,19 @@ map $http_user_agent $mobile { string $variable -http +stream Creates a new variable whose value depends on values of one or more of the source variables specified in the first parameter. - -Before version 0.9.0 only a single variable could be -specified in the first parameter. - Since variables are evaluated only when they are used, the mere declaration even of a large number of “map” variables -does not add any extra costs to request processing. +does not add any extra costs to connection processing. @@ -82,7 +68,7 @@ between source and resulting values. -Source values are specified as strings or regular expressions (0.9.6). +Source values are specified as strings or regular expressions. @@ -92,7 +78,7 @@ Strings are matched ignoring the case. A regular expression should either start from the “~” symbol for a case-sensitive matching, or from the “~*” -symbols (1.0.4) for case-insensitive matching. +symbols for case-insensitive matching. A regular expression can contain named and positional captures that can later be used in other directives along with the resulting variable. @@ -105,7 +91,7 @@ described below, it should be prefixed with the “\” symbol. The resulting value can contain text, -variable (0.9.0), and their combination (1.11.0). +variable, and their combination. @@ -185,7 +171,7 @@ default value size 32|64|128 -http +stream Sets the bucket size for the variables hash tables. @@ -200,7 +186,7 @@ The details of setting up hash tables ar size 2048 -http +stream Sets the maximum size of the variables diff --git a/xml/ru/GNUmakefile b/xml/ru/GNUmakefile --- a/xml/ru/GNUmakefile +++ b/xml/ru/GNUmakefile @@ -86,6 +86,7 @@ REFS = \ stream/ngx_stream_access_module \ stream/ngx_stream_core_module \ stream/ngx_stream_limit_conn_module \ + stream/ngx_stream_map_module \ stream/ngx_stream_proxy_module \ stream/ngx_stream_ssl_module \ stream/ngx_stream_upstream_module \ diff --git a/xml/ru/docs/index.xml b/xml/ru/docs/index.xml --- a/xml/ru/docs/index.xml +++ b/xml/ru/docs/index.xml @@ -8,7 +8,7 @@
@@ -501,6 +501,11 @@ ngx_stream_limit_conn_module + +ngx_stream_map_module + + + ngx_stream_proxy_module diff --git a/xml/ru/docs/http/ngx_http_map_module.xml b/xml/ru/docs/stream/ngx_stream_map_module.xml copy from xml/ru/docs/http/ngx_http_map_module.xml copy to xml/ru/docs/stream/ngx_stream_map_module.xml --- a/xml/ru/docs/http/ngx_http_map_module.xml +++ b/xml/ru/docs/stream/ngx_stream_map_module.xml @@ -7,15 +7,15 @@ - + rev="1">
-Модуль ngx_http_map_module создаёт переменные, +Модуль ngx_stream_map_module (1.11.2) создаёт переменные, значения которых зависят от значений других переменных. @@ -26,23 +26,13 @@ -map $http_host $name { - hostnames; - - default 0; - - example.com 1; - *.example.com 1; - example.org 2; - *.example.org 2; - .example.net 3; - wap.* 4; +map $remote_addr $limit { + 127.0.0.1 ""; + default $binary_remote_addr; } -map $http_user_agent $mobile { - default 0; - "~Opera Mini" 1; -} +limit_conn_zone $limit zone=addr:10m; +limit_conn addr 1; @@ -56,16 +46,12 @@ map $http_user_agent $mobile { строка $переменная -http +stream Создаёт новую переменную, значение которой зависит от значений одной или более исходных переменных, указанных в первом параметре. - -До версии 0.9.0 в качестве первого параметра можно было -указать только одну переменную. - @@ -73,7 +59,7 @@ map $http_user_agent $mobile { Поскольку переменные вычисляются только в момент использования, само по себе наличие даже большого числа объявлений переменных “map” не влечёт за собой никаких дополнительных -расходов на обработку запросов. +расходов на обработку соединений. @@ -83,7 +69,7 @@ map $http_user_agent $mobile { -Исходные значения задаются строками или регулярными выражениями (0.9.6). +Исходные значения задаются строками или регулярными выражениями. @@ -93,7 +79,7 @@ map $http_user_agent $mobile { Перед регулярным выражением ставится символ “~”, если при сравнении следует учитывать регистр символов, либо символы -“~*” (1.0.4), если регистр символов учитывать не нужно. +“~*”, если регистр символов учитывать не нужно. Регулярное выражение может содержать именованные и позиционные выделения, которые могут затем использоваться в других директивах совместно с результирующей переменной. @@ -106,7 +92,7 @@ map $http_user_agent $mobile { В качестве результирующего значения можно указать текст, -переменную (0.9.0) и их комбинации (1.11.0). +переменную и их комбинации. @@ -187,7 +173,7 @@ example.com 1; размер 32|64|128 -http +stream Задаёт размер корзины в хэш-таблицах для переменных . @@ -202,7 +188,7 @@ example.com 1; размер 2048 -http +stream Задаёт максимальный размер хэш-таблиц для переменных .