About Cloudflare proxy status and Let’s encrypt and too many redirects error

Stephen Chen
2 min readJan 5, 2022

Recently I add the DNS A record and enabled proxy status but It fails as below the second one.

Add new A record and enable proxy status
Fail with too many redirects error

Then I switch SSL/TLS encryption mode from Flexible to Full to fix the problem.

Switch from Flexible to Full

So I did some research….

Understand four options of SSL setting

First that’s understand 4 different SSL mode of Cloudflare support.

From Cloudflare docs

Understand Proxy status

I will just quote from Cloudflare docs, below the benefits of enabled proxy status

  • Hiding the origin IP address from attackers
  • Caching
  • Storing an HTTPS certificate on its edge servers
  • Providing support for Page Rules, Caching, Firewall, and more

Understand the error too many redirects

As title, but the problem is which part of your network traffic redirect from and to

  • Firstly when you run the Let’s Encrypt certificate install script in your server. It will add additional code makes a redirect from HTTP to HTTPS
Nginx
Apache2
  • So it redirects back to Cloudflare with protocol HTTPS

But when you are in the SSL Flexible mode. Cloudflare expects HTTP so it sends it to your server again and results in it repeating step 2、step 3 and step 4 cause the browser error TOO_MANY_REDIRECTS

With SSL mode Flexible. Network traffic repeating steps 2、 steps 3 and step 4 cause the error problem

Reference

--

--