I want to host a multi-tenant website where tenants can select a siteCode/subdomain, and as long as it's unique, I will create a folder for them and dump static files in there. I then want Nginx to serve the files from the correct folder based on the subdomain. e.g...
acme.domain.com -> serves everything from /acme folder
supermonkey.domain.com -> serves everything from /supermonkey folder
john.domain.com/stuff/stuff-list.html -> serves stuff-list.html from /john/stuff folder
While "domain.com" will be set and initialized by me, I do not want to have to change any config when I add more subdomains (perhaps thousands of them). Just assume I will handle creating the folders and all their contents just fine via an automated process.
Can someone tell me if Nginx can do this first of all, and, if so, what the config would look like?