I’m exploring how multi-tenant SaaS platforms (like Medium/Hashnode) handle custom domains.
Assume my application already supports multi-tenancy at the code level:
Identify tenant using the
HostheaderMap
Host→ tenant in DBServe tenant-specific data/content
Now the infrastructure question:
Users will point their domains to my app using:
A record → my IP, or
CNAME → my endpoint
How can a single server/app accept requests from N number of custom domains without using a Load Balancer?
I know these common approaches:
Use a Load Balancer (but adds fixed monthly cost + traffic charges)
Use a Linux VM with Nginx reverse proxy (works, but then scaling/SSL becomes tricky)
I’ve also seen Cloudflare Tunnel, but I want to avoid it due to potential extra latency.
Platforms I’m evaluating:
AWS Amplify
DigitalOcean App Platform
GCP Cloud Run
Render