Question
NGINX Websites all point to same place
I followed this tutorial: https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3
I have two websites: web1 and web2 and their respective directories on the droplet are:
1. /var/www/web1/public_html
2. /var/www/web2/public_html
In my sites-available directory I have a file called 'sites'. The contents of the file is here: http://pastebin.com/0yz3Lrwt
I have two files in the /etc/nginx/global directory: common.conf and wordpress.conf. - The contents of each is:
Common.conf: http://pastebin.com/gZxPeNBt
Wordpress.conf: http://pastebin.com/UdA9JrZr
I created a symbolic link from sites-available to sites-enabled and I have checked inside the sites-enabled directory and the only link in there is the one for the 'sites' file.
In the public_html directory for web2, I have index.html containing the following HTML:
Site 2
Working
The problem is that when I go to both web1.com and web2.com it comes up with the following text: "Site 2 Working". It seems like web1 and web2 are both pointing to /var/www/web2/public_html, when web1 should be pointing to /var/www/web1/public_html Anyone have any ideas? I've been stuck on this for a couple of days and can't work out how to get past it.
Add a comment
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×