Cache not fragmented by protocol?

Hey all, we have a strange case where we route traffic through a worker to our origin, and the backend service listens on both HTTP & HTTPS endpoint, with the HTTP redirecting (301) to HTTPS. The problem we are seeing is that when a request comes for an asset through HTTP, our origin will respond with the 301 redirect, which will come back to the client through the worker and get cached. So far, I would say that everything makes sense. The problem is that when the client will request the asset through HTTPS (using the location we sent back), he will get back again a 301 REDIRECT response (through CF cache this time), which doesn't make much sense as the protocol is different from the previous request. This ends up in endless redirect loop. Is this a known behaviour? I couldn't find any info online.
4 Replies
Hello, I’m Allie!
What’s your SSL setting?
honzabit
honzabit13mo ago
SSL on that zone is set on 'Flexible'
Hello, I’m Allie!
That might be the issue. When the browser shows HTTPS, then it is still hitting your origin with HTTP. Your origin then responds with a redirect to HTTPS, causing the loop Try setting your SSL setting to Full
honzabit
honzabit13mo ago
Thanks for your input @HardAtWork, I will do some tests and get back with any findings 🙂
Want results from more Discord servers?
Add your server