Is it possible to whitelist IPs on railway?

I want to setup cloudflare and then only allow cloudflare to make API requests to my backend hosted on railwat. Where can I add which IPs can only access the backend?
12 Replies
Percy
Percy10mo ago
Project ID: N/A
charbelh3
charbelh310mo ago
N/A
Fragly
Fragly10mo ago
You can find all the IPs for a specific region here: https://utilities.up.railway.app/cidr-list?value=us-west1
charbelh3
charbelh310mo ago
my question is how to block any incoming request if it's not from cloudflares IPs, directly on railway rather than my app itself (just like you can whitelist IPs on Ec2 instances etc..)
Fragly
Fragly10mo ago
ooh I see what you mean I don't think there's a place where you can do that on railway if not on your app
charbelh3
charbelh310mo ago
I see :/
Brody
Brody10mo ago
fragly is correct, railway does not offer any firewall rules, this is something your app needs to handle
charbelh3
charbelh310mo ago
if im not wrong adding cloudflare is enough, if I only use my cloudflare custom domain I can add rules on there, and no one can bypass them
Brody
Brody10mo ago
doesnt stop someone from accessing the railway domain of your app though
charbelh3
charbelh310mo ago
I believe I can remove the default generate railway domain that way I force everyone to use my custom domain through cloudflare
Brody
Brody10mo ago
you can still access the railway app via a railway domain, the cname value railway gives you but thats random so it should be sufficient just something to keep in mind
charbelh3
charbelh310mo ago
oh okay
Want results from more Discord servers?
Add your server