Custom Hostnames

Hello, I'm trying to setup Multi-Tenant SaaS where users can point their custom domains to my website's subdomains. So for example, for user "Demo", their custom domain would be : https://demo.heliup.xyz If that user has their own custom domain, for example https://astralics.com, they should be able to point that domain to the subdomain on my website. Now, I've setup the CNAME records for astralics to point to https://demo.heliup.xyz , Then I went to the dashboard of the main website (heliup.xyz) to setup custom hostnames, And then I verified everything, but when i try to visit https://astralics.com it shows a Invalid SSL certificate Error code 526. I don't know what to do at this point, any help is greatly appreciated.
No description
No description
20 Replies
Chaika
Chaika•3mo ago
526 means it gave a certificate it just wasn't valid. Expired/Revoked/self-signed or more likely it just didn't contain the target hostname. If your two domains in your example are in the same account this gets more messy because cross-account pointing without SaaS is allowed. You'd need to add both the www and apex astralics.com version as two separate custom hostnames, then I'd make sure that your origin heliup.xyz responds to requests with other host headers like astralics.com with the heliup.xyz certificate and the proper content
lunix
lunixOP•3mo ago
i THINK ive fixed it, but im facing an issue with my host https://railway.app
Railway
Railway
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
lunix
lunixOP•3mo ago
if u go to https://astralics.com it is rendering content, but it is not showing the real content because that domain isn't registered on my railway host.
Chaika
Chaika•3mo ago
yea most likely it's what I said above "make sure that your origin heliup.xyz responds to requests with other host headers like astralics.com with the heliup.xyz certificate and the proper content", it's seeing the host header as astralics.com and saying "hey I don't have a config for this"
lunix
lunixOP•3mo ago
mhm, do you have any info on how i could do that?
Chaika
Chaika•3mo ago
the most simple assumption is you'd add it as another custom domain within railway. Obviously not too scalable though, depends if you have a unique IP with them and can just have a fallback for that all or how the platform works
lunix
lunixOP•3mo ago
i have fallback for heliup.xyz which is the main domain and I can't add more custom domains to railway
Chaika
Chaika•3mo ago
when I say "fallback" I mean within railway
lunix
lunixOP•3mo ago
so my only solution ATM would be to purchase a VPS
Chaika
Chaika•3mo ago
You could have your fallback domain within CF For SaaS be a worker which requests your railway site and pass a custom header indictating which customer it is but would have to pay worker costs
lunix
lunixOP•3mo ago
mhm what would u recommend? getting a vps and using coolify as the PaaS
Chaika
Chaika•3mo ago
coolify isn't a free pass out of it either is my understanding, I was actually helping someone else with it and CF For SaaS. had to use a custom traefik config to set a default ssl cert and they were having issues with renewal and such, maybe not too bad though espec if you've used it and traefik before. I would keep it simple and simple nginx w/ 15-year cf origin cert, and you can have fallback/everything you want and forward to anything. Could be even in front of coolify or whatever
lunix
lunixOP•3mo ago
it might not be a full pass out of it but it would definitely have less issues than railway @Chaika apologies for pinging, would u be able to help if i got a vps and i was facing any issue with the cloudflare for saas service?
Chaika
Chaika•3mo ago
To the same extent as here sure, we're just community volunteers who try to provide best effort support. I don't know every stack or possible configuration but CF For SaaS really isn't that complex, just need a fallback for any host that serves a valid cert for your own domain and whatever content you want.
lunix
lunixOP•3mo ago
sounds good, thank you in advance. I will chat here again soon once i've purchased a VPS and set it up 🙂 hey! @Chaika are you here? I have configured a VPS with coolify and i've set everything up ( I think )
lunix
lunixOP•3mo ago
currently this is https://demo.heliup.xyz
No description
lunix
lunixOP•3mo ago
then i have this domain name astralics.com that points to demo.heliup.xyz
No description
lunix
lunixOP•3mo ago
but for some reason it renders the error that the board is not found ( even tho it exists, as shown in the first screenshot )
No description
Chaika
Chaika•3mo ago
it's going to be because the host header of the cf for saas site is different. I'm not familiar with coolify although I have seen someone else use it for this use case in the past, I assume there's either some fallback option or just a matter of adding the second site to the configuration in coolify?
lunix
lunixOP•3mo ago
idk i can't figure it out i decided to just remove the custom domain optino it's too frustrating and can't get it to work
Want results from more Discord servers?
Add your server