Question

Cloudflare + Vercel: ERR_TOO_MANY_REDIRECTS after I pointed my domain

Solved · 2101 viewsasked by emeka

My domain is on Cloudflare. Added the CNAME to Vercel with the orange cloud on. Site now shows "This page isn't working, redirected you too many times". Vercel domain page also shows a warning. Claude told me to add a redirect rule in next.config.js which made it... the same.

What I’ve tried

Cleared cookies, tried incognito, removed Claude's redirect again.

Comment
SSL mode in Cloudflare is Flexible, isn't it bea_quinn

2 answers

Marked as helpful by the asker
jonas_k

Cloudflare SSL/TLS mode is on Flexible. That means Cloudflare talks to Vercel over plain HTTP. Vercel redirects HTTP to HTTPS. Cloudflare gets the redirect, passes it to the browser, browser asks Cloudflare over HTTPS again, Cloudflare asks Vercel over HTTP again... loop.

Cloudflare dashboard → SSL/TLS → set mode to Full (strict). Loop gone within a minute.

Even simpler: set the record to DNS only (grey cloud). Vercel already does CDN and certificates, running Cloudflare's proxy in front of it mostly adds a second layer to debug. That also clears the warning on Vercel's domain page.

Comment
Full (strict), fixed instantly. Going grey cloud too, I don't need two CDNs emeka
Happy to help. Keep an eye on the domain page in Vercel after going grey, the warning should clear within a few minutes. jonas_k
This is the #1 Cloudflare question I see anywhere. Should be pinned somewhere. cloudkat
Same fix for Netlify behind Cloudflare. thandeka
nadia_r

If you do keep the orange cloud: Vercel may have trouble issuing or renewing the certificate for your domain behind the proxy. That's the warning on the domain page. Grey cloud avoids the whole category.

Comment