How can i handle multiple domains dynamic?
I need to register domain to my proxy service when a tenant register and configure their domain
39 Replies
You would want to utilize wildcard domains -
https://docs.railway.app/guides/public-networking#wildcard-domains
Im use wildcard for tenants that not have domains. Example tenant.myweb.com. But how can i handle for a custom domain that tenant have dynamically or by code for example tenantdomain.com -> myProxyService
I would recommend doing that through cloudflare with a cloudflare tunnel
ok thx i never use cloudflare im going to learn
@Brody Hi brody sorry the mention, i created a tunner and deploy the cloudflare tunnel connection on railway "cf-tunnel" but i cant connect over private networks to service
i configure through http
your services will need to listen on ipv6 and a fixed port
the private network is ipv6 only
yes my proxy use :: and port 3000
cloudflare config
whats with the underscore
internal service
the name of service xd
what kind of proxy app?
simple http redirect to anothers service by certain conditions
like a tenant template or admin etc
more specifically?
something you coded? or nginx?
by subdomain or custom domain redirect to the service of tenant
coded
in express
js
show me the app.listen
logs
is the cloudflare tunnel is the same project?
yes
its trying to dial port 80
how can i change port or i need to set host on port 80?
save this config
that log isnt what we would want to be looking at
what can i do?
send all the logs
okay try accessing it again
and what do the logs say now
scroll down?
i reload site and nothing
remove the underscore from everything to do with the proxy service
some i saw i dont create a private network on tunnel
that can be a problem?
i said nothing
underscore removed and now works
awsome
😂
lessen learnt, dont give things strange names
thats name its only for get on top of monorepo, my bad!
thx again brody!
no problem
for wildcard in cloudflare i need to do something?
i wouldnt know how thats done in cloudflare
i create a cname manually with * and works
at leats something i can do and works xd
awsome