-
-
Couldn't load subscription status.
- Fork 16.6k
Description
Would you be open to a patch allowing the use of subdomain routing with no SERVER_NAME pre-configured?
The motivation is to allow multiple domains to match a request, just like it does when SERVER_NAME is None, while still benefiting from the nice subdomain matcher. This is particularly useful in DEV to be able to develop on machine.local but also tunnel the instance to a vpn, and use things like xip.io (which all change the host).
The change would probably be mostly focused on create_url_adapter(). I imagine a configuration variable switching a different logic on for this function: it would look for subdomains and deduce the server_name which is the reverse of what's going on today.
The list of subdomains could come from the configuration I suppose, or better be deduced from the compilation of the routes.
- What do you think of this idea?
- If you are opposed to it, what alternative approach do you suggest instead?
- If you are not opposed to it, how do you think the implementation should look like?