Mercurial > hg > nginx-site
diff xml/en/docs/stream/ngx_stream_map_module.xml @ 1743:3d686cb47c2c
Documented the map module in stream.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 05 Jul 2016 17:58:34 +0300 |
parents | xml/en/docs/http/ngx_http_map_module.xml@5ee34b8faa79 |
children | c6b5826b64f7 |
line wrap: on
line diff
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 @@ <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> -<module name="Module ngx_http_map_module" - link="/en/docs/http/ngx_http_map_module.html" +<module name="Module ngx_stream_map_module" + link="/en/docs/stream/ngx_stream_map_module.html" lang="en" - rev="4"> + rev="1"> <section id="summary"> <para> -The <literal>ngx_http_map_module</literal> module creates variables +The <literal>ngx_stream_map_module</literal> module (1.11.2) creates variables whose values depend on values of other variables. </para> @@ -26,23 +26,13 @@ whose values depend on values of other v <para> <example> -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; </example> </para> @@ -56,23 +46,19 @@ map $http_user_agent $mobile { <value>string</value> <value>$variable</value></syntax> <default/> -<context>http</context> +<context>stream</context> <para> Creates a new variable whose value depends on values of one or more of the source variables specified in the first parameter. -<note> -Before version 0.9.0 only a single variable could be -specified in the first parameter. -</note> </para> <para> <note> Since variables are evaluated only when they are used, the mere declaration even of a large number of “<literal>map</literal>” variables -does not add any extra costs to request processing. +does not add any extra costs to connection processing. </note> </para> @@ -82,7 +68,7 @@ between source and resulting values. </para> <para> -Source values are specified as strings or regular expressions (0.9.6). +Source values are specified as strings or regular expressions. </para> <para> @@ -92,7 +78,7 @@ Strings are matched ignoring the case. <para> A regular expression should either start from the “<literal>~</literal>” symbol for a case-sensitive matching, or from the “<literal>~*</literal>” -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 “<literal>\</literal>” symbol. <para> The resulting value can contain text, -variable (0.9.0), and their combination (1.11.0). +variable, and their combination. </para> <para> @@ -185,7 +171,7 @@ default value <directive name="map_hash_bucket_size"> <syntax><value>size</value></syntax> <default>32|64|128</default> -<context>http</context> +<context>stream</context> <para> Sets the bucket size for the <link id="map"/> variables hash tables. @@ -200,7 +186,7 @@ The details of setting up hash tables ar <directive name="map_hash_max_size"> <syntax><value>size</value></syntax> <default>2048</default> -<context>http</context> +<context>stream</context> <para> Sets the maximum <value>size</value> of the <link id="map"/> variables