a month ago
Hello Railway team,
I'm preparing to deploy a private beta of my application, Aquarella, using ASP.NET Core 10, Blazor Server, Docker and SQLite.
Before deploying, I need to configure HTTPS and forwarded headers securely.
ASP.NET Core requires trusted proxies or networks to process X-Forwarded-Proto and other forwarded headers safely.
I have a few questions:
-
Does Railway publish stable IP addresses or CIDR ranges for its reverse proxies?
-
If not, what is the officially recommended way to configure ASP.NET Core Forwarded Headers Middleware securely on Railway?
-
Is there a supported method to trust Railway's proxy without trusting arbitrary external clients or allowing spoofed forwarded headers?
-
How should HTTPS redirection and secure authentication cookies be configured behind Railway's proxy?
I want to avoid disabling proxy validation or using insecure workarounds.
The application has not been deployed yet.
Thank you!
1 Reply
a month ago
We don't publish stable IP addresses or CIDR ranges for the proxy addresses your container sees as its socket peer. The 100.64.0.0/10 addresses you may see aren't a supported contract and can change, so they shouldn't be hard-coded as KnownProxies or KnownNetworks.
What we do guarantee is header handling at our public HTTP edge, including .up.railway.app domains. The edge overwrites X-Real-IP, X-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Host, replacing any copies the caller sent. X-Forwarded-Proto is set to https, and X-Real-IP carries the client IP. Public TLS terminates at the edge, and traffic from the edge to your app runs over an encrypted WireGuard tunnel, so your app sees plain HTTP on its listening port.
We don't have a signed-header, mTLS or edge-only ingress mechanism that lets your app prove a request came through the edge. Requests sent over private networking (*.railway.internal) skip the edge, so its header sanitization doesn't apply to them. Other services in the same project and environment can reach your port directly and set their own forwarding headers. Trusting forwarding headers from any immediate peer is therefore only safe if you treat every service in that environment, and any TCP proxy you add, as trusted. Private networks are isolated between projects and environments.
That means X-Forwarded-Proto is reliable for public traffic, and that's what HTTPS redirection and Secure cookie decisions depend on. How you set up the middleware is up to you, based on that trust boundary. More detail is in our public networking specifications.
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • about 1 month ago