Linux‎ > ‎服务‎ > ‎

nginx

server_name _

系统默认的配置里面有server_name _。我对这个_纠结了很久,后来在Freenode得到答案,原来'_'在域名中是非法的字符,所以是用来作为一个其它都不匹配的fallback。

[22:56] <fossilet> Hello. Do you know what does "server_name _" means? I cannot find it by goole.
[22:56] <fossilet> Where is it documented?
[22:56] <fossilet> Thanks.
[22:58] <kolbyjack> It doesn't mean anything special.  _ is just an invalid hostname, and it shouldn't ever match a valid request, so it's often used as a placeholder for fallback hosts.  http://wiki.nginx.org
[23:00] <fossilet> kolbyjack: thank you, I was puzzled all night.
[23:01] <kolbyjack> You're welcome.  There's a very popular myth that it's a magical value that will make the server default automatically, but that's incorrect.

404

Comments