#Remix behind a Cloudflare Worker Proxy

1 messages · Page 1 of 1 (latest)

steep jolt
#

👋 Hi!

I'm trying to put a Cloudflare worker infront of my remix app to do some things like clean headers, and add rewrite rules for certain paths.

However, my app only works with JavaScript disabled, for some reason Remix doesn't respect the 302 returned by the Cloudflare worker if JavaScript is enabled.

I see on my local deploy there is 204 returned, do I need to handle that in my worker? Something like if queryParam includes _data and response is 302 to return 204 and x-remix-redirect?

It seems like that would work but I'm worried that would break JS disabled workflows. I feel like I'm missing something here.

steep jolt
#

Ok my first issue was that I wasnt passing along my query param, now I'm getting the 204 and x-remix-redirect header, but now its not re-requesting from my server and doing a client side redirect 😭

#

Looks like I need this redirectDocument

steep jolt
#

Noooo it didn' work, I'm getting back x-remix-reload-document but it still does the client side redirect, I wonder if I need to upgrade to latest remix

steep jolt
#

I FOUND IT MAYBE

#

Aaaaaand there's a PR already out for it ha