Multi-tenant dynamic multiple domains with SSL pointing to single Host/CDN

I am building a multi-tenant social network platform of sorts. Something like you’d see at a squarespace or shopify where you as a customer can map your custom domain name eg, community,mywebsite,com to the hosted platform eg, app,socialnetwork,com

I’m sure some reverse proxy magic would need to be involved. And some kind of component for free automatic SSL creation.

I imagine whatever solution should be able to handle thousands of mapped domain names all pointing to the single location.

Currently the web app can be hosted as a static site, so i’ve had success with AWS CloudFront etc, but they have limits (10) on the number of domains and its a very manual process, although i did find some APIs. Just unsure if this is an acceptable use of their platform.

Does CloudFlare have some kind of dynamic TLS service?

I’ve come across traefik.io which may be what i’m after, but then theres set up.

So i’m fairly certain what i need is:

  • map customer’s domains to our stuff
  • generate free ssl cert
  • apply cert and route domain. There is nodejs code that looks like it would serve that using SNI and the https createServer SNICallback however i’m unsure just how many domains that could handle, suppose its dependant on how performant the callback code is when say requesting from a database the list of domains and certs

Appreciate any info, pointers in the right direction and naturally if theres an all in one service that does it all i’ll consider throwing money at the problem :slight_smile:

I’ve also asked this question on StackOverflow here https://stackoverflow.com/questions/57931882/multi-tenant-dynamic-multiple-domains-with-ssl-pointing-to-single-host-cdn

Each domain needs to be set up individually. You might want to have a look at their partner program https://www.cloudflare.com/partners/

Alternatively you could use the API to set up each domain individually. api.cloudflare.com

Thanks for the reply @sandro are you referring to each domain needs to be registered and namespace from registrar pointing to CloudFlare? I don’t think that’d be a great customer experience.
I’ll look into the partner program link, thanks.

I get the feeling the SSL Custom Hostnames enterprise feature might be what i’m after. https://support.cloudflare.com/hc/en-us/articles/217371987-Managing-Custom-Hostnames-SSL-for-SaaS-

I am sure Cloudflare will be quite flexible in terms of features when it comes to an Enterprise account.