nginx conflict between multiple virtual hosts config files

December 11, 2013 1.9k views
Hi, I have followed the guide on . For one virtual host, it works correctly. But when I've tried to add the 2nd, the new /etc/nginx/sites/available/ config file has not been recognized by nginx (I'm getting the content from the other domain). Somehow, if I remove the config file for the first host I created, the new one starts working. So I suppose there's a conflict between both. Both sites-available config files have the same structure: server { listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 root /var/www/; index index.html index.htm; # Make site accessible from http://localhost/ server_name; access_log /var/log/nginx/; error_log /var/log/nginx/; } Any suggestion please?
4 Answers
In the tutorial, make sure to complete the 2nd-to-last paragraph in Step Five—Set Up the Virtual Hosts (i.e. create a symbolic link to the /etc/nginx/sites-enabled/ directory, for EACH domain).
Thanks Pablo, that seems to be in order - both domains have their respective symbolic links from /etc/nginx/sites-enabled/* to /etc/nginx/sites-available/*
It's weird, it has started working again, and I think I didn't touch anything. I'll perform a backup, just in case I don't touch anything else and stops working once again :-D

I'm serious, I think I didn't touch anything :-/
"I'm serious, I think I didn't touch anything"

DNS records can take up to 48 hours to propagate through the Internet (even in situations with multiple DNS changes; some records may be available almost immediately, while others take much longer).
Have another answer? Share your knowledge.