The following Nginx (v 1.2.1) configuration
server {
listen 80;
server_name aaa.example.com;
root /var/www/aaa;
}
server {
listen 80;
server_name hello-world.example.com;
root /var/www/hello;
}
because the server_name of the second server contains a dash
(-
), nginx will always open the second server (whether you go to hello-world.example.com or aaa.example.com)
I fixed it by renaming hello-world
to helloworld
(removing the dash fixed the issue).
Isn't this a bug in Nginx?