希望有人可以提供帮助,我一直在尝试使用虚拟主机设置nginx,但默认主机总是覆盖我指定的任何其他主机。
这是我在/etc/nginx/sites-enabled
server {
listen 80;
server_name sub.example.com;
return 404;
}
server {
listen 80 default;
server_name *.example.com;
return 501;
}
和access.log
显示
*.*.*.* - - [30/Oct/2013:04:09:11 +0400] "GET / HTTP/1.1" 501 582 "http://sub.example.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36"
*.*.*.* - - [30/Oct/2013:04:09:14 +0400] "GET / HTTP/1.1" 501 582 "http://www.example.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36"
提前感谢任何帮助/想法。
蚂蚁