Multi tenant website based on subdomain

I have single website with one specfic database for each customer. The database should be selected based on the subdomain of the request. How can i do this with ServiceStack?
https://customer1.site.com should use the customer1 database
https://customer2.site.com should use the customer2 database…

Thanks
Marco

Look at MultiTennantAppHostTests for a stand-alone example of how you can configure ServiceStack to use multi-tenant databases.