DEV Community


Discussion on: What Wait Why: Heroku Doesn’t Want You to be Naked

prnthh profile image
Pranith Hengavalli • Edited

Another awesome feature of DNS is the ability to specify a wildcard (*) as the subdomain.

I use this configured with nginx running as a reverse proxy on my server, so it can direct a request depending on the subdomain the request was sent to. This allows me to dynamically generate new subdomains and I don't have to constantly update the domain records.

For example: goes to files served from the /var/www/static/xyz folder goes to files served from the /var/www/static/abc folder goes to the NodeJS app running on port 8080
but all of these are guided by the same wildcard CNAME rule.

It's useful to have sites on separate subdomains because they have their own root address space for file references.

flaque profile image
Evan Conrad Author

That is wicked cool.

krushndayshmookh profile image
Krushn Dayshmookh

Can you please point me to resource on how to do it?

Forem Open with the Forem app