From 3b2482a861725dac48e96d184f6827dae86fda5d Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Fri, 10 Apr 2026 15:25:54 +0400 Subject: [PATCH] Refined description of map and server names matching. The search is performed up to the first match. The search priority is always applied. While here, simplified description. Unified wording based on text review from f09e5433. --- xml/en/docs/http/ngx_http_core_module.xml | 8 +++----- xml/en/docs/http/ngx_http_map_module.xml | 19 +++++++++--------- xml/en/docs/http/server_names.xml | 20 +++++++++---------- xml/en/docs/stream/ngx_stream_core_module.xml | 8 +++----- xml/en/docs/stream/ngx_stream_map_module.xml | 19 +++++++++--------- xml/ru/docs/http/ngx_http_core_module.xml | 8 +++----- xml/ru/docs/http/ngx_http_map_module.xml | 7 +++---- xml/ru/docs/http/server_names.xml | 15 +++++++------- xml/ru/docs/stream/ngx_stream_core_module.xml | 8 +++----- xml/ru/docs/stream/ngx_stream_map_module.xml | 7 +++---- 10 files changed, 53 insertions(+), 66 deletions(-) diff --git a/xml/en/docs/http/ngx_http_core_module.xml b/xml/en/docs/http/ngx_http_core_module.xml index 774c49e41..a8bbba6a7 100644 --- a/xml/en/docs/http/ngx_http_core_module.xml +++ b/xml/en/docs/http/ngx_http_core_module.xml @@ -10,7 +10,7 @@ + rev="115">
@@ -2661,10 +2661,8 @@ Before 0.8.48, the machine’s hostname was used by default. -During searching for a virtual server by name, -if the name matches more than one of the specified variants, -(e.g. both a wildcard name and regular expression match), the first matching -variant will be chosen, in the following order of priority: +The search is performed in the following order of priority +and terminates on the first matching variant: diff --git a/xml/en/docs/http/ngx_http_map_module.xml b/xml/en/docs/http/ngx_http_map_module.xml index e1c3a3672..05d45a8d2 100644 --- a/xml/en/docs/http/ngx_http_map_module.xml +++ b/xml/en/docs/http/ngx_http_map_module.xml @@ -10,7 +10,7 @@ + rev="6">
@@ -153,32 +153,31 @@ indicates that the variable is not cacheable (1.11.7). -If the source value matches more than one of the specified variants, -e.g. both a mask and a regular expression match, the first matching -variant will be chosen, in the following order of priority: +The search is performed in the following order of priority +and terminates on the first matching variant: -string value without a mask +the string value without a mask -longest string value with a prefix mask, +the longest string value with a prefix mask, e.g. “*.example.com -longest string value with a suffix mask, +the longest string value with a suffix mask, e.g. “mail.* -first matching regular expression -(in order of appearance in a configuration file) +the first matching regular expression +(in order of appearance in the configuration file) -default value +the default value diff --git a/xml/en/docs/http/server_names.xml b/xml/en/docs/http/server_names.xml index 666858aae..f9f33a25e 100644 --- a/xml/en/docs/http/server_names.xml +++ b/xml/en/docs/http/server_names.xml @@ -8,7 +8,7 @@
@@ -52,27 +52,27 @@ server { -When searching for a virtual server by name, if name matches more than one of -the specified variants, e.g. both wildcard name and regular expression match, -the first matching variant will be chosen, in the following order of precedence: +The search is performed in the following order of priority +and terminates on the first matching variant: -exact name +the exact name -longest wildcard name starting with an asterisk, e.g. -“*.example.org” +the longest wildcard name starting with an asterisk, +e.g. “*.example.org -longest wildcard name ending with an asterisk, e.g. “mail.*” +the longest wildcard name ending with an asterisk, +e.g. “mail.* -first matching regular expression -(in order of appearance in a configuration file) +the first matching regular expression +(in order of appearance in the configuration file) diff --git a/xml/en/docs/stream/ngx_stream_core_module.xml b/xml/en/docs/stream/ngx_stream_core_module.xml index a6628691a..23597c5bd 100644 --- a/xml/en/docs/stream/ngx_stream_core_module.xml +++ b/xml/en/docs/stream/ngx_stream_core_module.xml @@ -9,7 +9,7 @@ + rev="45">
@@ -591,10 +591,8 @@ machine’s hostname is inserted. -During searching for a virtual server by name, -if the name matches more than one of the specified variants, -(e.g. both a wildcard name and regular expression match), the first matching -variant will be chosen, in the following order of priority: +The search is performed in the following order of priority +and terminates on the first matching variant: diff --git a/xml/en/docs/stream/ngx_stream_map_module.xml b/xml/en/docs/stream/ngx_stream_map_module.xml index 0be8603d4..e4337905b 100644 --- a/xml/en/docs/stream/ngx_stream_map_module.xml +++ b/xml/en/docs/stream/ngx_stream_map_module.xml @@ -10,7 +10,7 @@ + rev="3">
@@ -139,32 +139,31 @@ indicates that the variable is not cacheable (1.11.7). -If the source value matches more than one of the specified variants, -e.g. both a mask and a regular expression match, the first matching -variant will be chosen, in the following order of priority: +The search is performed in the following order of priority +and terminates on the first matching variant: -string value without a mask +the string value without a mask -longest string value with a prefix mask, +the longest string value with a prefix mask, e.g. “*.example.com -longest string value with a suffix mask, +the longest string value with a suffix mask, e.g. “mail.* -first matching regular expression -(in order of appearance in a configuration file) +the first matching regular expression +(in order of appearance in the configuration file) -default value +the default value diff --git a/xml/ru/docs/http/ngx_http_core_module.xml b/xml/ru/docs/http/ngx_http_core_module.xml index 9065b4363..8484c2eb7 100644 --- a/xml/ru/docs/http/ngx_http_core_module.xml +++ b/xml/ru/docs/http/ngx_http_core_module.xml @@ -10,7 +10,7 @@ + rev="115">
@@ -2657,10 +2657,8 @@ server { -При поиске виртуального сервера по имени, -если имени соответствует несколько из указанных вариантов, -например, одновременно подходят и имя с маской, и регулярное выражение, -будет выбран первый подходящий вариант в следующем порядке приоритета: +Поиск производится в следующем порядке приоритета +и прекращается на первом подходящем варианте: diff --git a/xml/ru/docs/http/ngx_http_map_module.xml b/xml/ru/docs/http/ngx_http_map_module.xml index f5d04664e..32d8b4e89 100644 --- a/xml/ru/docs/http/ngx_http_map_module.xml +++ b/xml/ru/docs/http/ngx_http_map_module.xml @@ -10,7 +10,7 @@ + rev="6">
@@ -155,9 +155,8 @@ example.com 1; -Если исходному значению соответствует несколько из указанных вариантов, -например, одновременно подходят и маска, и регулярное выражение, -будет выбран первый подходящий вариант в следующем порядке приоритета: +Поиск производится в следующем порядке приоритета +и прекращается на первом подходящем варианте: diff --git a/xml/ru/docs/http/server_names.xml b/xml/ru/docs/http/server_names.xml index 1e454ed47..e3150c88b 100644 --- a/xml/ru/docs/http/server_names.xml +++ b/xml/ru/docs/http/server_names.xml @@ -8,7 +8,7 @@
@@ -52,10 +52,8 @@ server { -При поиске виртуального сервера по имени, -если имени соответствует несколько из указанных вариантов, -например, одновременно подходят и имя с маской, и регулярное выражение, -будет выбран первый подходящий вариант в следующем порядке приоритета: +Поиск производится в следующем порядке приоритета +и прекращается на первом подходящем варианте: @@ -63,12 +61,13 @@ server { -самое длинное имя с маской в начале, например -“*.example.org” +самое длинное имя с маской в начале, +например “*.example.org -самое длинное имя с маской в конце, например “mail.*” +самое длинное имя с маской в конце, +например “mail.* diff --git a/xml/ru/docs/stream/ngx_stream_core_module.xml b/xml/ru/docs/stream/ngx_stream_core_module.xml index ab512bf06..019903803 100644 --- a/xml/ru/docs/stream/ngx_stream_core_module.xml +++ b/xml/ru/docs/stream/ngx_stream_core_module.xml @@ -9,7 +9,7 @@ + rev="45">
@@ -595,10 +595,8 @@ server { -При поиске виртуального сервера по имени, -если имени соответствует несколько из указанных вариантов, -например, одновременно подходят и имя с маской, и регулярное выражение, -будет выбран первый подходящий вариант в следующем порядке приоритета: +Поиск производится в следующем порядке приоритета +и прекращается на первом подходящем варианте: diff --git a/xml/ru/docs/stream/ngx_stream_map_module.xml b/xml/ru/docs/stream/ngx_stream_map_module.xml index 83acaea5a..a5870d6ab 100644 --- a/xml/ru/docs/stream/ngx_stream_map_module.xml +++ b/xml/ru/docs/stream/ngx_stream_map_module.xml @@ -10,7 +10,7 @@ + rev="3">
@@ -141,9 +141,8 @@ example.com 1; -Если исходному значению соответствует несколько из указанных вариантов, -например, одновременно подходят и маска, и регулярное выражение, -будет выбран первый подходящий вариант в следующем порядке приоритета: +Поиск производится в следующем порядке приоритета +и прекращается на первом подходящем варианте: