﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1171	Clarify $server_name variable with regex server_name directive	davidjb		"The documentation for $server_name mentions the following:

{{{
$server_name
    name of the server which accepted a request.
}}}

When using the `server_name` directive with regex and captures (like in the [https://nginx.org/en/docs/http/ngx_http_core_module.html#server_name documentation]), it was unclear to me without testing what the `$server_name` variable would end up being.  After looking at the [https://trac.nginx.org/nginx/browser/nginx/src/http/ngx_http_variables.c#L1572 source], I can now see the variable is always the string literal of the matching `server_name`.

I'd suggest adding an additional line to the documentation for `$server_name` to clarify the expected value of this variable, such as the following:

$server_name
    name of the server which accepted a request.

    If the [https://nginx.org/en/docs/http/ngx_http_core_module.html#server_name server_name] directive contains one or more regular expressions, $server_name will be the string literal of the matching regular expression; it is not evaluated in this variable."	enhancement	closed	minor		documentation	1.10.x	wontfix			N/A	N/A
