一种可能导致 ERR_TOO_MANY_REDIRECTS 的原因

in 网站 with 9 comments

前言

  在此前,我为自己的一些站点加上 HTTPS ,但总是提示 ERR_TOO_MANY_REDIRECTS (重定向次数过多)。起初,我以为是自己 Nginx 的配置除了问题,但是在查阅了很多资料,并对配置文件进行修改后还是没有效果,遂放弃了折腾。一段时间后,重新想起此事,然后再使用 Google 并且用关键词 ERR_TOO_MANY_REDIRECTS 查询了一些资料(百度和 CSDN 全是复读机),终于找到一篇很详细的文章讲解了各种可能的情况。在浏览文章的过程中,我发现了由 Cloudflare 引起的重定向次数过多,这时我才恍然大悟,我 TM 确实设置的是他那样的。阅读这部分文章后,发现原来是 Cloudflare 的 SSL/TLS(Crypto) 设置导致的。

原因

  因为在 Cloudflare 的 SSL/TLS 设置选项中,如果你选择了 Flexible ,那么所有对你的服务器的请求都是通过 HTTP 发送的,而如果服务器上已经设置了将 HTTP 重定向到 HTTPS 的话,就会发生重定向循环。

解决方法

  由此,想要解决这个问题,只需要将 SSL/TLS 设置中的选项,从 Flexible 更换到 Full 或者 Full(strict) 即可。

将 SSL/TLS 加密模式修改为 FULL

将 SSL/TLS 加密模式修改为 FULL

  当然,你也可以选择创建 Always Use HTTPS 页面规则,来解决这个问题,而不会导致循环。

参考链接

Responses

captcha
请输入验证码

  1. viagra cialis and levitra [url=https://newfasttadalafil.com/]Cialis[/url] acheter cialis generique en france Fgcpvu Monhsd Cialis Wdcmkp Low back pain and stiffness secondary to sacroiliitislimited motion in lumbar spine https://newfasttadalafil.com/ - Cialis

    Reply
  2. johyday

    stromectol ebay Canada Pharmacy Drugs

    Reply
  3. inhedia

    Levitra Generico Vardenafil ivermectin human dosage

    Reply
  4. cheap cialis from india The no-observed effect-level NOEL for developmental toxicity was 30 mg kg, which provided maternal exposure to unbound tadalafil concentrations approximately 5 times the exposure at the MRHD based on AUC

    Reply
  5. cheapest cialis generic online , Alaska Forum on the Environment, American Fisheries Society annual meeting, World Indigenous Peoples Conference on Education, NPR National Native News, BBC radio and TV, and local radio and TV stations

    Reply
  6. Most of our deliveries go smoothly, but if there s a problem with a product, our refund policy assures that buyers are satisfied with the product they ordered, or always get their money back what is priligy dapoxetine Goes on easily and won t abraid the sides or back of the violin

    Reply
  7. is there a generic cialis available Erectile dysfunction is a common condition that affects men in all age groups, making Stendra a valuable treatment option if you re affected

    Reply
  8. best place to buy cialis online reviews 5 mmHg , see CLINICAL PHARMACOLOGY

    Reply
  9. dairy and doxycycline Topical agents such as corticosteroids and 5 minoxidil and oral biotin may be partially useful as adjuncts.

    Reply