Opened 6 years ago
Closed 6 years ago
#1171 closed enhancement (wontfix)
Clarify $server_name variable with regex server_name directive
|Reported by:||davidjb||Owned by:|
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 documentation), it was unclear to me without testing what the
$server_name variable would end up being. After looking at the source, I can now see the variable is always the string literal of the matching
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:
name of the server which accepted a request.
If the 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.
Change History (1)
comment:1 by , 6 years ago
|Status:||new → closed|
The server_name directive documentation explicitly says that the first name specified will be used as the primary name:
It doesn't matter if the name uses wildcards, or regular expressions - the name will be as written in the configuration. And I think it is clear form the
Additionally, the suggested text is not technically correct:
$server_name. It is mean to specify a string form the configuration, in contrast to
$hostwhich is from the client request.
Overall, I don't see any improvement in the clarification suggested.