Module ngx_http_map_module | english русский 简体中文 עברית 日本語 türkçe news about download security advisories documentation pgp keys faq links books support donation trac wiki nginx.com | ||||||||||||||||||
The Example Configuration
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 $http_user_agent $mobile { default 0; "~Opera Mini" 1; }
Directives
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 used, the mere existence
of even a large number of declared “
Parameters inside the Source values are specified as strings or regular expressions (0.9.6).
A regular expression should either start from the “
If a source value matches one of the names of special parameters
described below, it should be prefixed with the “ The resulting value can be a string or another variable (0.9.0). The directive also supports three special parameters:
If the source value matches more than one of the specified variants, e.g. both mask and regular expression match, the first matching variant will be chosen, in the following order of precedence:
Sets the bucket size for the map variables hash tables. Default value depends on the size of the processor’s cache line. Details of setting up hash tables are provided in a separate document.
Sets the maximum |