I'm trying to save some time on my development machine by not creating a new nginx server config for each new site I test. I'm wondering if there is a way for nginx to change the root directory based on the domain I'm loading.
So if I have
mysite.loc
myothersite.loc
something.loc
Nginx will look inside
www/mysite.loc
www/myothersite.loc
www/something.loc
That would allow me to test new things on mock domains just a little bit faster since I don't have to mess with a new /etc/nginx/sites-available config for each one.
server {
listen 80;
server_name *.loc;
root /www/$host;
index index.html;
}
Is this possible? Is there another way to do it?