R
Railway

✋|help

Cloudflare for Saas domains compatible with Railway?

PPatrick8/28/2023
Hi! We'd love to use Railway but custom domains are holding us back so far. We use Cloudflare for custom domains (https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/) and I haven't been able to figure out how to make it work with Railway. Host header rewrites are only available in the Cloudflare Enterprise Plan it seems which is too expensive for us atm.
We could use CF workers to rewrite the request but that would mean that every request goes through a worker and I can't judge at the moment whether that adds too much overhead and/or cost.
Did anyone else try this so far? Would love to know whether we are the first or what other solutions were found so far.
I reached out via email already but thought maybe the community has some insights 🤗
Cheers
PPatrick8/28/2023
071f7771-ab05-488c-b53b-47a7ec81aac1
BBrody8/28/2023
so I'm not familiar with this cloudflare for saas thing, but how would it's nameservers differ from regular name servers? or do they?
PPatrick8/28/2023
I'm not sure what you mean. Every customer uses their existing dns provider, Cloudflare gives us just a CNAME address and _acme_challenge that the customers enter into their provider pretty much like Railway does it. If for example a custom domain is roadmap.railway.com then I think the problem is that when a request with host roadmap.railway.com arrives at Railway it's not clear where to route the request since that domain is not in our Railway project per se, assuming we have the domains productlane.com and *.productlane.com in Railway.
BBrody8/28/2023
if you had productlane.com in railway, wouldnt you just need to set the cname domain railway gave you as the cname value for productlane.com
PPatrick8/28/2023
Unfortunately that doesn't work. The traffic from the custom arrives at Railway but then Railway doesn't know where to route the traffic to since the "host" header doesn't contain productlane.com is my understanding so far
BBrody8/28/2023
why wouldn't the host contain productlane.com ? what would the host contain instead?
PPatrick8/28/2023
the host contains "roadmap.railway.com" in that example. When I tried to set this up the Railway "Not found" screen showed up when going to the custom domain.
BBrody8/28/2023
maybe the fact that you are using domains you down own in your example is throwing me off, could you restructure your example with example domains you do own?
BBrianJM8/28/2023
OP - you're going to have the same challenge with Railway as similar platforms (DO Apps, etc).
PPatrick8/28/2023
In our project on Railway we currently have the custom domains "productlane-dev.com" and "*.productlane-dev.com". For our customers we want to provide the functionality to host their roadmap/changelog on their custom domain. So using Cloudflare for Saas I now created "roadmap.pgvr.dev" to host my roadmap page. "roadmap.pgvr.dev" now shows the Railway not found screen.
The DNS records are in the picture and the CNAME value of "roadmap.pgvr.dev" is "pgvr.customers.productlane-dev.com"
PPatrick8/28/2023
I know :/ It works with AWS currently where we specify the hostname of the load balancer directly as the CNAME value "productlane-dev.com"
BBrody8/28/2023
ah i see what you mean now
going to tag in @Angelo for this one
BBrianJM8/28/2023
I have my eye on this too. This will come up in the future for our org.

Short term plan is a different deployment (service) for the front end app for each client, but scaling is a concern.
Or we may just roll our own load balancer, as we have before.
BBrody8/28/2023
i believe there should be a railway solution for this, if there isn't already, since this is not the first time ive seen someone have this use case

Looking for more? Join the community!

R
Railway

✋|help

Join Server
Recommended Posts
Custom domain with A record (not CNAME record)Hi, I want to add a custom domain in one of my projects. Docs says I need to add a CNAME record in Very slow connectionHey, I've built an app that uses Remix, Prisma and Postgres and is hosted in vercel and railway. LoPostgres sql update query inserting "$1" instead of "?"I have a Postgres server and I runned the query: update "Table_name" set("column_name") = ("Column_nInquiry about Next.js SSR and ISR Support on RailwayHello Railway Community 👋, I'm currently exploring the possibility of migrating my Next.js projectPerformance questionsHi all! Does performance between Hobby and Pro plan differs? I'm mostly curious about initial connHow to specify deployment strategy?Hey, previously i'm a fly io user and I want to migrate to Railway. Is it possible to define the deI do not scroll rightWhen I access log and view it but I do not scroll right to sell full logs. Is it a bug of you?Build failed directus api templateI tried to deploy directus app using railway template (Directus api) and it failed every time. Does Network Error While sending a file.I have uploaded my telegram bot on a Railway Pro plan. The bot sends file back to users through Telego-cron jobs not running in railwayHello, so I'm using the go-cron(https://github.com/go-co-op/gocron) library for managing my cron jobpnpm not foundHi! I'm having trouble building my app, and haven't had success with any of the suggestions with othDo you guys have prepaid options?Say I pay 5$ once and I get to use those 5$ worth of resources all year round. I'd rather do that thChange Heroku to RailwayI need more info because I have a problem with Heroku with my hosted proyect there WebSocket doesnt I am getting this error on my deployment```console GET failed with status code 403 (a proxy could be disallowing the use of 'Upgrade: derp')Flask app wont work with port 0.0.0.0application not respondingmemory usage doesn't decreasememory usage of one of my python processes was instantly increased to ~2700 mb, it was my mistake, bAutomated Postgres backup onto a volume ?Since now the project I was developing for a while is almost ready for production, we need to make show can i deploy my vue projecti get this errorHosting Django backend and React frontend from the same DomainI have two services, one for my backend and one for my frontend. They currently have two separate doResponse Pending with OpenAIHi I have SAAS website running on Railway using OpenAI with Next js , the problem is the endpoint no