Dynamic Subdomain Handling in a Web App (Flask) [closed]

All Flask’s routing constructs support the subdomain keyword argument (this includes support for route variables). @app.route(“https://stackoverflow.com/”, subdomain=”static”) def static_index(): “””Flask supports static subdomains This is available at static.your-domain.tld””” return “static.your-domain.tld” @app.route(“/dynamic”, subdomain=”<username>”) def username_index(username): “””Dynamic subdomains are also supported Try going to user1.your-domain.tld/dynamic””” return username + “.your-domain.tld”

Virtualhost For Wildcard Subdomain and Static Subdomain

<VirtualHost *:80> DocumentRoot /var/www/app1 ServerName app1.example.com </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/example ServerName example.com </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/wildcard ServerName other.example.com ServerAlias *.example.com </VirtualHost> Should work. The first entry will become the default if you don’t get an explicit match. So if you had app.otherexample.com point to it, it would be caught be app1.example.com.

Any drawbacks to AWS certificate manager wildcard certificates?

The upside is that it’s very flexible. A wildcard cert allows you to add alternate domains in the future. The “normal” downsides to a star cert in general is they can be expensive and they create the potential for a security vulnerability. For your use case they are not expensive at all, AWS Certificate Manager … Read more

Non-dot-wildcard (*-foo.example.com) for bind?

The reason why it doesn’t work is because it’s not defined behavior within the RFCs. It must be implemented as an extension of the software you’re using. RFC4592 cements the definition of a wildcard record pretty firmly: 2.1.1. Wildcard Domain Name and Asterisk Label A “wildcard domain name” is defined by having its initial (i.e., … Read more