nginx dynamic virtual hosts
- by Anagio
With nginx is there a method to setup mass dynamic virtual hosts similar to the way apache2 can be configured? I'm setting up an saas application each user will have their own subdomain and i'd like to use nginx over apache2.
Thanks
Code below should be how to configure
map $http_host $subdir {
hostnames;
default "default";
.foo.bar.com "foo";
.baz.bar.com "baz";
}
server {
root /path/to/$subdir;
}