Introducing Railway's new edge proxy

Hey all!

We're introducing a new edge proxy that we've built from the ground-up. Our new proxy is designed specifically for Railway workloads and engineered to be more performant, reliable, and extensible than our current proxy.

What's a edge proxy?

When your users visit your domain, the request is first routed to Railway's edge proxy before it reaches your app's underlying server. All inbound traffic to your Railway-hosted application is routed through this proxy.

What's changing?

We are replacing our current proxy with our custom-built proxy. This change is designed to be seamless and will not require any action on your part, but you may start taking advantage of it today.

We've added a new service setting that allows you to opt-in to new proxy. This setting is available to all users, and you can enable it at any time:

Image of New Edge Proxy toggle

Enabling this toggle will upgrade your service to use new proxy automatically. There will be no downtime for your users when you enable the new proxy. The upgrade process is designed to cut traffic over to our new proxy seamlessly, but it may take up to a minute for it to take effect.

The new proxy has several key benefits over our current proxy:

  • Near-instant deploy cutovers: Adding a new domain to your service currently takes up to a minute before it's provisioned. Pushing a new deployment may take a few seconds before we start routing traffic to it. With our new proxy, this is near-instant - your new domain is ready to go as soon as you add it, and your new deployment is live as soon as it's ready.

  • Improved Error Pages: The new proxy comes with new error pages that allows us to debug and resolve issues faster on our end. When a network error occurs, the error page will display a traceable Request ID that you can forward to us for faster resolution.

This new proxy helps us unlock features such as exposing multiple PORTs, automatic/magic PORT detection, network logs and metrics, advanced routing rules / load balancing algorithms, and more.

In the near future, the new proxy will be the default proxy for all new domains created on Railway. We will also automatically upgrade all existing domains on Railway to run on the new proxy. No action is required on your part, and this will not cause any downtime. We'll announce and communicate the timeline of this in advance once we've determined that the new proxy is stable enough for general availability.

Need help?

The new proxy is currently in beta. While we've tested it extensively, there may be edge cases that we haven't accounted for. If you run into any issues, please report them here 👇

Completed

0 Threads mention this feature

13 Replies

akhil-naiduPRO

10 months ago

How to turn on edge-proxy using config as code or via public api?


ryangavinHOBBY

9 months ago

Could you look into some of these reports that the edge proxy is not 100% compatible with Safari?

https://help.railway.app/questions/django-safari-pwa-7246187c


9 months ago

Our new edge proxy has been powering >10% of all Railway traffic since launch. For the past two months, we have fixed all critical bugs related to reliability, and have been improving its stability across the board.

We are now ready to begin moving more traffic to the new edge proxy.

Starting next week, we will begin moving all Railway-generated domains (*.up.railway.app) to our new edge proxy. Custom domains will remain on our legacy proxy unless you have opt-ed into the new proxy via the “Enable New Proxy” toggle in your service’s settings.

This change will be entirely transparent to users with zero expected downtime. No action is required on your part. If you run into network-related issues without any code changes or recent deployments, please reach out to us by leaving a reply here.


efstajasPRO

9 months ago

We just ran into a strange issue and it turned out to be likely related to one of our deployments being routed through the new edge proxy now.

We have this "proxy endpoint" on our frontend app that takes requests from our frontend, injects an access token, and forwards the request back to the client: https://github.com/drips-network/app/blob/main/src/routes/api/multiplayer/%5B...path%5D/%2Bserver.ts

Today, suddenly, without any changes from our end, the staging deployment of our app broke because it wasn't able to parse responses from this proxy endpoint anymore. Seemingly nothing had changed, and direct requests to the express app also still worked just fine, so it was a bit of a mystery. Meanwhile, the prod app (1:1 same as staging except it's connected to the staging instance of the express server) still worked fine.

Turns out that the staging instance was being routed through the edge proxy now. And apparently that edge proxy is returning gzipped responses when it wasn't previously (?). And because we were just forwarding the raw Response from the express server, it was forwarding the new Content-Encoding header seemingly added by the Edge proxy too, which caused decoding to fail client-side because it actually got a non-compressed payload.

I ended up fixing this by just constructing a new Request object server-side instead of returning the original response from the express server directly: https://github.com/drips-network/app/pull/1170/files

Not complaining because we should've done that from day 1, just though I'd post here in case anyone else falls into this pit :) Glad it affected our staging server before prod.


20k-ultraEMPLOYEE

9 months ago

This likely happened because all new domains are on the v2 HTTP Proxy. If a PR created a new environment in staging than it would have made a new domain and thus use the new proxy.


matteosonoioHOBBY

8 months ago

Out of curiosity, could you perhaps share some engineering details on how you built this proxy from scratch and made sure it's reliable and performant enough to replace your previous solution?

It would be interesting to know which language platform you chose (Rust? Go?) and if you found the ecosystem of that platform suitable for building this proxy (I assume you didn't implement HTTP from scratch ).


myersben9HOBBY

8 months ago

Our new edge proxy has been powering >10% of all Railway traffic since launch. For the past two months, we have fixed all critical bugs related to reliability, and have been improving its stability across the board.

We are now ready to begin moving more traffic to the new edge proxy.

Starting next week, we will begin moving all Railway-generated domains (*.up.railway.app) to our new edge proxy. Custom domains will remain on our legacy proxy unless you have opt-ed into the new proxy via the “Enable New Proxy” toggle in your service’s settings.

This change will be entirely transparent to users with zero expected downtime. No action is required on your part. If you run into network-related issues without any code changes or recent deployments, please reach out to us by leaving a reply here.

well this aged like fine wine


vambePRO

8 months ago

You just *** my buisness for 1 hour, thanks a lot guys


myersben9HOBBY

8 months ago

You just *** my buisness for 1 hour, thanks a lot guys

This incident made me realize how important it is to always have a backup... Going to work on making one now. Railway you should do the same.


paulcoyleHOBBY

8 months ago

Sorry, I can't stand griping like this. Nobody wants an outage like this but it will happen on any service. If your business is – whatever three asterisks means – by an outage then it behooves you to have some kind of failover strategy even if that means it is on a different service. Don't complain, get redundant!


8 months ago

Deepest apologies to anybody affected by this.

Unfortunately, this was a process error which had nothing to do with the technical side of the proxy. It was an issue with our Terraform stack which cycled the proxies simultaneously.

We had 2 different fallbacks fail here. We've put in additional fallback measures to guarantee that this is not an issue in the future

You can read the full post mortem below.

https://blog.railway.app/p/incident-august-27-2024

Thank you,

Jake Cooper

Founder @ Railway


8 months ago

You just *** my buisness for 1 hour, thanks a lot guys

Deepest apologies here. I'm going to reach out personally over email right now.


7 months ago

Going to unpin this thread since we have moved over everyone to the new proxy with final issues resolved. Thank you everyone who's helped us build a more stable platform.


Status changed to Closed brody 7 months ago


Status changed to Completed unicodeveloper about 2 months ago


Introducing Railway's new edge proxy - Railway Help Station