I just started a linode server, and I seem to have an issue where no matter what domain name I put into a website (that is registered with linode in the DNS manager), nginx always returns the same website for the virtual server HOST_A (or whatever happens to be the first parsable hostname when I messed around with it). I have been trying to fix this for a couple of hours, but I have no idea if this is due to the way I have my dns set up or due to nginx (however at this point I am leaning towards the former)
I have 5 separate domains hosted on godaddy, all which I have put in the DNS manager using this guide
http://www.linode.com/wiki/index.php/Linode_DNS. I just updated the nameservers at godaddy with
ns1.linode.com
ns2.linode.com
ns3.linode.com
ns4.linode.com
ns5.linode.com
The linode OS I use is archlinux, and I put the same hostname in /etc/rc.conf, /etc/hosts and /etc/rc.d/conf
Code:
server {
listen 80;
server_name HOST_A;
location / {
root PATH_A;
index index.html index.htm;
}
}
server {
listen 80;
server_name HOST_B;
location / {
root PATH_B;
index index.html index.htm;
}
}
server {
listen 80;
server_name HOST_C;
location / {
root PATH_C;
index index.html index.htm;
}
}
server {
listen 80;
server_name HOST_D;
location / {
root PATH_D;
index index.html index.htm;
}
}
server {
listen 80;
server_name HOST_E;
location / {
root PATH_E;
index index.html index.htm;
}
}
If I comment out every single server bar one, then it works fine, otherwise it always defaults to the first parsed server
Log files for nginx don't show anything
I think this may be a DNS issue, where the hostname isn't actually being sent to nginx, but instead an IP
To be sure, one doesn't actually require an FQDN for the site to work in /etc/hosts (I have multiple seperate domains hosted on the same site)?. Is the FQDN also something you completely make up?
Any ideas?