Configuring network redirects

I think we talked about this in Spectrum but I’d like to start a new conversation about redirects.

What I mean is that it would be great if we could configure redirects to happen in Fly’s network layer rather than at the application level.

For example HTTP -> HTTPS or even domain.com -> www.domain.com.

3 Likes

When we made this work in a previous life, we were surprised how often people needed to only redirect certain requests, even for https. I think it’s generally better to do it in app but we should investigate adding an option to HTTP services.

2 Likes

+1 for this feature request. I would like all the requests to be redirected from HTTP to HTTPS automatically.

I have a next.js application that is composed of ssr pages but also static pages, the only way to do this at the application level is to use a custom express server on top of next.js to redirect such requests. But then you lose the next.js optimisation over the static pages.
With services like netlify, vercel, render.com this is done automatically :slight_smile:

1 Like

+1 for this as well (for a catch-all HTTP->HTTPS redirect)!

Rule-based redirects later on would also be cool…

1 Like

+1
I would also like to redirect all httphttps with a single fly.toml entry.

1 Like

We’ve just shipped a feature that tackles this. Check it out below :slight_smile:

2 Likes