Hey! Does anyone here have experience supporting multiple custom domains on a single platform? I want to support this with Webase and I have some ideas on how to do it, but curious if anyone here has solved that before?<p>Ideally the solution would support:<p>1) updating webserver config to know about new domain via an API and
2) Updating DNS to know about the domain via an API and
3) Need to support SSL (LetsEncrypt)<p>And I'd like to automate all of this so a person does not need to touch it.<p>Thanks for any insight!
I wrote about this a few days ago on how I did this with Caddy: <a href="https://laravel-news.com/unlimited-custom-domains-vapor" rel="nofollow">https://laravel-news.com/unlimited-custom-domains-vapor</a>
I've had to do this a few times and I'm not sure there's ever a single "best way to do it"<p>1) The webserver can be configured to respond for any domain. Then your application software can look at the HTTP host header to decide which client you are working with.<p>2) I've used DJBDNS in the past because it's very easy to generate the necessary config files and if I recall didn't require restart (since the config is stored in a "database file" - binary flat file in this case). You could also try dynamically rewriting the BIND config and restarting it via a cronjob every 10 minutes.<p>3) No clue here but it should be easy to automate<p>The worst part of all this is having to write the DNS docs for users so they can point their domain correctly. DNS is incredibly confusing to setup for "mere mortals" due to the many different registrars with varying DNS editing capabilities. Caching and IP address perplexity makes it worse.
Caddy is designed for precisely this use case: <a href="https://caddyserver.com" rel="nofollow">https://caddyserver.com</a><p>It can handle thousands of domains easily, with Let's Encrypt (or any other ACME CA), even if you don't control your customer's domains.<p>Hit up the forums if you have any questions: <a href="https://caddy.community" rel="nofollow">https://caddy.community</a>
1 and 3: use caddy. I prefer the config format of caddy over the toml files used by Traefic. and caddy 2 even has an api for that Purpose. Caddy is rock solid.<p>2: depending on the use case you may get away with an wildcard/catch all dns entry. If customers shall bring their own domain name, they will have to create an cname record anyway.