问题描述
因此,一天前我在github页面上设置了自定义域,而在namecheap上没有问题。然后,我尝试通过github上新添加的对页面上https的支持,切换到Https。经过太多的挫败之后,我切换到了CloudFlare for Https,但现在出现错误 ERR_TOO_MANY_REDIRECTS
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
这是我的CloudFlare上的DNS设置。
Here's my DNS settings on CloudFlare.
推荐答案
在加密选项卡中检查SSL设置。您应该将其设置为 Full。如果将其设置为 Flexible,那么即使客户端浏览器通过HTTPS连接到Cloudflare,Cloudflare也会使用HTTP连接到源。在这种情况下,GitHub可能会通过重定向到HTTPS进行响应-并未意识到原始客户端已在使用HTTPS,因此此重定向会创建一个循环。
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.
这篇关于如何在自定义github页面域上修复ERR_TOO_MANY_REDIRECTS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!