Fix ERR_TOO_MANY_REDIRECTS on Coolify (Cloudflare Flexible SSL Loop)
Error: ERR_TOO_MANY_REDIRECTS — This page isn't working. your-domain.com redirected you too many times.
The browser bounced between HTTP and HTTPS endlessly. Cloudflare and your Coolify origin disagree on which protocol to use, so each keeps redirecting back to the other.
Cloudflare's SSL/TLS mode is set to Flexible (the default), which makes Cloudflare talk to your origin over plain HTTP. Coolify's Traefik proxy redirects all HTTP to HTTPS. So Cloudflare sends HTTP, Traefik 301s it to HTTPS, Cloudflare (in Flexible) connects back over HTTP, and the loop never ends. Coolify's own FAQ documents this and it is reported in GitHub issues #3004 and #3911 when enabling the Cloudflare proxy.
The fix
In the Cloudflare dashboard, open the affected domain > SSL/TLS > Overview and check the encryption mode. If it shows Flexible, that is the cause.
Confirm Coolify has terminated TLS on the origin first. Load the app over HTTPS directly (server IP or the domain with the Cloudflare proxy temporarily greyed-out/DNS-only) so you know the origin can serve HTTPS before you trust it from Cloudflare.
Change the Cloudflare SSL/TLS encryption mode to at least Full. Coolify's FAQ states you must set it to at least Full; prefer Full (strict), which validates the origin certificate and is satisfied by Coolify's Let's Encrypt cert.
If you genuinely cannot issue an origin cert yet and must stay on Flexible, instead remove the force-HTTPS redirect on the Coolify side so the origin stops 301-ing HTTP to HTTPS. Pick one direction only — never run Flexible plus force-HTTPS together.
Purge the Cloudflare cache (Caching > Configuration > Purge Everything) so cached 301 responses stop replaying the loop.
Test in a private/incognito window so the browser doesn't replay its own cached redirect.
Verify it worked
Trace the redirect chain — it should land on a single HTTP 200, not an endless run of 301s.
curl -sIL https://your-domain.com | grep -E 'HTTP/|location'Related Coolify errors
- NET::ERR_CERT_AUTHORITY_INVALID
- TRAEFIK DEFAULT CERT / self-signed certificate
- acme: error: 429 :: POST :: too many certificates already issued for exact set of domains, retry after ...
- unable to obtain ACME certificate for domains "your-domain.com": unable to generate a certificate for the domains [your-domain.com]: error: one or more domains had a problem: [your-domain.com] acme: error presenting token / authorization failed