Sometimes, we can use allll of the IPs, we don’t get the luxury of having an infinite amount available, and we need to make do with ONE IP.
Well, NGINX doesnt stress about that, we just need to set it up. Nginx will take a look at the Host Headers, and use those to determine what server the user is looking for.
So here is more-or-less how it works:
===
server {
listen www.domain1.com:80;
access_log /var/log/nginx/host.domain1.access.log main;
root /var/www/domain1;
server_name www.domain1.com;
xxx
}
}
server {
listen www.domain2.com:80;
access_log /var/log/nginx/host.domain2.access.log main;
root /var/www/domain2;
server_name www.domain2.com;
xxx
}
===
Now the important thing is the server_name.
Here, you put the redirected DNS hosts, and bob is your uncle… It works with the StreamCache setup perfectly.