I would like to create multiple subdomains using nginx from 1 IP address. So it would be something like this:
http://demo1.192.168.0.27
http://demo2.192.168.0.27
Someone already asked this question in the past.
nginx - two subdomain configuration
I tried the same way but I'm not able to do it.
Here's my code:
events {
}
http {
server {
server_name demo1.192.167.0.27;
root /data/sites/demo1;
index index.html;
location / {
try_files $uri $uri/ /404.html;
}
}
server {
server_name demo2.192.167.0.27;
root /data/sites/demo2;
index index.html;
location / {
try_files $uri $uri/ /404.html;
}
}
}
When I go to
http://demo1.192.168.0.27
http://demo2.192.168.0.27
It said, This site can’t be reached
Not sure why it's not working for me.