Module ngx_stream_num_map_module
The ngx_stream_num_map_module module (1.29.3) creates variables whose values depend on numeric values or numeric value ranges.
This module is available as part of our commercial subscription.
Example Configuration
num_map $remote_port $port_allow {
default 0;
80 1;
443 1;
<=1023 0;
8080-8090 1;
}
Directives
| Syntax: | num_map
[$number]
$variable { ... } |
|---|---|
| Default: | — |
| Context: | stream |
Describes how the values of the specified variable depend on numeric values or numeric value ranges.
Since variables are evaluated only when used, the mere existence of even a large number of declared “num_map” variables does not cause any extra costs for connection processing.
Parameters inside the num_map block specify a mapping between source and resulting values.
Source values are specified as numbers or as numeric ranges.
The following special parameters are also supported:
default- sets the resulting value if the source value matches none of the specified variants. When
defaultis not specified, the default resulting value will be an empty string. include- includes a file with values. There can be several inclusions.
volatile- indicates that the variable is not cacheable.
© 2002-2021 Igor Sysoev
© 2011-2026 Nginx, Inc.
Licensed under the BSD License.
https://nginx.org/en/docs/stream/ngx_stream_num_map_module.html