We are creating a multi-tenant web application where we identify tenants through a subdomain (customer1.ourapp.com, customer2.ourapp.com, etc.).
Subdomain settings must be data driven - i.e. we donβt want to change the IIS configuration (manually or programmatically) every time we get a new client.
In MVC, where it is best to check the correctness of the subdomain in the query (i.e. the subdomain exists in some table in the database)
Some options that I have considered
I think that conceptually this is a routing task, so does the last option seem right? those. a request with a subdomain that does not exist is essentially an invalid URL, so it should not be mapped to a route and should go through 404 instead. This will also allow us to explicitly identify routes that require or do not require a valid subdomain
source share