Proper way to 301 redirect* to*

Having the app issue a 301 redirect if the host field in the request object is not equal to “” doesn’t have results I expected. From what I can see, a 301 response is not forwarded to the requester but followed by the proxy.


Is that hosted on Fly or indeed the same app?

Only it’s not currently possible to turn off access to (e.g Disable the default domain) and so I was wondering if your intent here was to block access using to enforce If so … I wonder if there is some loop, where the redirect is coming back … but the custom domain … returns the redirect. And so on.

If not, I’m not sure why a 301 returned by your app would not be simply returned to the client :thinking: The proxy has no need to get involved in that. Maybe try redirecting to a totally separate non-Fly site, like e.g or something as a quick test, and see what happens?


It was indeed a loop. Good guess. The redirect is working perfectly fine now. Thanks for your response!

1 Like