Clerk + CF Proxy = Redirected too many times

Hello CF Team, so I started using cloudflare as a proxy for ssl handling in a nextjs project with clerk for authentication. But when I enable CF Proxy it gives me an ERR_TOO_MANY_REDIRECTS. I read the CF documentation but am not sure how to find out which case applies? How do I debug such a case in the first place?
4 Replies
DarkDeviL
DarkDeviL2w ago
Make sure that your SSL/TLS encryption mode is set to Full (Strict): -> https://dash.cloudflare.com/?to=/:account/:zone/ssl-tls
jkli
jkliOP2w ago
Thank you that fixed it. Could you be so kind to explain why FULL made the difference while flexible broke it, so that I can understand it for next time?
Chaika
Chaika2w ago
Flexible sends request to origin as HTTP (plaintext). Your origin tries to redirect to https (secure), a normal and good security default. Cloudflare helpfully proxies the redirect back to the user. Rinse and repeat until browser gives up
jkli
jkliOP2w ago
ah! I see, thanks. That makes sense.

Did you find this page helpful?