官网:Server names
翻译部分:Wildcard names
开始!
A wildcard name may contain an asterisk only on the name’s start or end, and only on a dot border.
一个通配符名称只包含在名字开头或者在名字结尾的星号,且只能在.的边界上。
The names “
www.*.example.org
” and “w*.example.org
” are invalid.
www.*.example.org 和 w*.example.org 名字都是无效的。
www.*.example.org 的星号不在开头也不在结尾,所以无效。
w*.example.org 的星号也是,同时*不在.的边界上。
However, these names can be specified using regular expressions, for example, “
~^www\..+\.example\.org$
” and “~^w.*\.example\.org$
”.
然而,这些无效的名字可以用正则表达式来定义,例如:
~^www\..+\.example\.org$
~^w.+\.example\.org$
An asterisk can match several name parts.
一个星号*可以匹配多个名字部分。
The name “
*.example.org
” matches not onlywww.example.org
butwww.sub.example.org
as well.
server_name *.example.org,不仅可以匹配www.example.com还可以匹配www.sub.example.com.
*分别匹配了www和www.sub。
A special wildcard name in the form “
.example.org
” can be used to match both the exact name “example.org
” and the wildcard name “*.example.org
”.
格式为.example.org的
特殊通配符名称可以用来匹配确切名称example.org和通配符名称*.example.org。