How to fix ERR_TOO_MANY_REDIRECTS on custom github pages domain?
Asked Answered
I

2

21

So I had github pages set up with a custom domain without problem on namecheap a day ago. Then I tried switching to Https via github's newly added support for https on pages. After too much frustration I switched over to CloudFlare for Https but I'm now getting an error ERR_TOO_MANY_REDIRECTS

Here's my DNS settings on CloudFlare.

DNS Settings Cloudflare

Instate answered 3/5, 2018 at 0:15 Comment(2)
you website is working fine at the moment. Do you still have the issue? Did you try another browser?Isia
Yeah I ended up getting it to work. I had one of my page rules set to redirect to https. Switching the redirect to http fixed it as SSL is set to full on http.Instate
H
74

Check your SSL setting in the Crypto tab. You should have it set to "Full". If it is set to "Flexible", then Cloudflare will use HTTP to connect to the origin, even when the client browser connects to Cloudflare over HTTPS. GitHub is probably responding with a redirect to HTTPS in this case -- not realizing that the original client is already using HTTPS, and so this redirect creates a loop.

Hake answered 4/5, 2018 at 20:1 Comment(1)
Thank you for this. I thought I needed to make it lower (Flexible) when it initially wasn't working. However, I discovered in the Pages setting in the GitHub repository said that it was still validating the DNS. Once that was completed, it still did not work until I moxed SSL settings back to "Full".Engenia
F
4

More info here: https://support.cloudflare.com/hc/en-us/articles/115000219871

The two typical causes of redirect loop errors are:

  • Cloudflare SSL options that are incompatible with your origin web server’s configuration, and
  • Page Rule misconfiguration.
Fredi answered 24/4, 2019 at 9:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.