http://stackoverflow.com/questions/16264412/nginx-host-multiple-websites-cant-get-the-correct-website
I would like to know how to host multiple websites on a single IP address.
I'm using Nginx in Ubuntu server 12.10
I created two websites named joequah, joeproject and test in both
/etc/nginx/sites-avaliable
/etc/nginx/sites-enabled
Setting for /etc/nginx/sites-enabled/joeproject
server {
listen 80;
root /usr/share/nginx/www/joeproject;
index index.html index.htm index.php;
server_name www.joeproject.free joeproject.free;
.
.
.
}
Settings for /etc/nginx/sites-enabled/test
server {
listen 80;
root /usr/share/nginx/www/test;
index index.html index.htm index.php;
server_name test;
.
.
.
}
Settings for /etc/nginx/sites-enabled/joequah
server {
listen 80;
root /usr/share/nginx/www/joequah;
index index.html index.htm index.php;
server_name www.joequah.free joequah.free;
.
.
.
}
I have 2 domains
www.joequah.free
www.joeproject.free
I provided the same IP address to both domain. IP address only, no nameserver. I don't know what is nameserver.
Both domains will always show the SAME content.
And they won't show the same content everytime.
What I mean is joequah.free and joeproject.free will show the content of joequah now.
But later both will show content of joeproject or maybe test.
They will show content randomly, but both always showing the same content at the same time.
How to make them show the correct content? Did I configure wrongly?
Please help thanks
Edited 1 time(s). Last edit at 04/30/2013 03:52AM by joequah1.