Virtual Hosting (one subdomain per user)

Hey!

I want to dynamically map multiple subdomain to the same service.

Ex: user1.tweety.sh and user2.tweety.sh will map to the same server, that will use the request origin to find out what to do.

Can I achieve this on koyeb ?

Thanks

Hey!

This is theoretically possible, but maybe slightly inconvenient if you have a lot of users.

You’d need to setup a CNAME *.tweety.sh pointing to <your-org-id>.cname.koyeb.app from your domain name provider.

We don’t (yet) support assigning wildcard domains to an app. Without this feature, you need, for each user, to:

  • Declare a domain on Koyeb
  • Assign the domain to your app

This could be automated using our API.

Thanks for the quick answer!

Sadly i think this is a deal breaker for me, as I even want multiple subdomain per user (ex: <user>-<app>.tweety.sh). It would probably be too expensive with the current pricing.

Looks like fly.io support this feature: Custom Domains and SSL Certificates · Fly Docs.

I hope that you’ll add support for it at some point !

We have a feature request for this here, we had a few requests for this already.

How many domains do you need?

An arbitrary number really.

I’m taking inspiration from val.town, where each val has it’s own subdomain, and each user can have as many val as he want.