4 days ago
Title: Railway HTTPS ingress — trusted proxy CIDRs or secure alternative?
Hello Railway Community,
I'm preparing to deploy a Node.js application on Railway using its public HTTPS ingress.
The application currently uses strict reverse-proxy validation. It accepts forwarded HTTPS headers only when the connecting socket's IP address belongs to an explicitly configured trusted CIDR allowlist.
I haven't been able to establish which source IP ranges Railway's ingress proxies use.
Could someone from Railway or the community clarify:
-
Does Railway provide documented, stable source IP addresses or CIDR ranges for its HTTPS ingress proxies?
-
If these addresses are dynamic, what is Railway's recommended secure approach for validating
X-Forwarded-ProtoandX-Forwarded-Host? -
Is there a supported way to distinguish legitimate Railway ingress traffic from untrusted requests without allowing all private-network addresses or using
0.0.0.0/0? -
Is there an established solution for Node.js applications that require strict reverse-proxy trust validation?
I'm looking for a secure, maintainable solution that works with Railway's standard hosting infrastructure.
Thank you for your help!
1 Reply
4 days ago
We don't publish stable source ranges for the proxy addresses your app sees as its socket peer. An observed address such as one in 100.64.0.0/10 is not a supported contract and can change at any time, so it shouldn't be hard-coded as a trusted-proxy CIDR.
For requests through our public HTTP edge, including .up.railway.app and custom domains, the edge overwrites X-Forwarded-Proto (set to https), X-Forwarded-Host (the original host), X-Forwarded-For and X-Real-IP. It replaces any copies the caller sent instead of appending to them, so a client can't forge them through the edge. Use X-Real-IP for the client address. In Express, req.ip comes from the socket peer and X-Forwarded-For based on your trust proxy setting, not from X-Real-IP.
The limit is the trust boundary. Other services in the same project environment can reach your listening port directly over private networking (*.railway.internal) and can send their own forwarding headers. A raw TCP proxy, if you enable one, also passes headers through unsanitized. Trusting forwarding headers from any peer therefore means trusting every path to that listener. That's reasonable when the service has no TCP proxy and only trusted services share its environment. We don't offer a signed-header or mTLS mechanism that lets your app prove a request came through the edge.
Edge Rules can allowlist or block client source IPs at the edge, but they aren't available on the Trial plan.
Status changed to Awaiting User Response Railway • 4 days ago