使用SSL和CloudFlare将Phoenix应用程序部署到Heroku“太多重定向” [英] Deploying Phoenix Application to Heroku with SSL and CloudFlare "too many redirects"

查看:337
本文介绍了使用SSL和CloudFlare将Phoenix应用程序部署到Heroku“太多重定向”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近刚刚部署了一个在本地主机上运行的Phoenix应用程序。



域名是 。使任何人尝试使用 www 版本重定向到非www 版本。



所有值得注意的是我使用的是https和SSL,一切都已经在Heroku上正确配置。



对于一些奇怪的原因,我继续收到一个太多的重定向错误,尽管一切似乎正确设置。

解决方案

我有同样的问题。请按照以下步骤操作:


  1. 在页面规则下,删除或禁用任何可能
    的转发规则

  2. 如果您在Heroku上使用SSL,请确保您的cloudflare dns设置正在DNS下的cloud中使用.herokudns.com

  3. 列,确保您的云层是灰色而不是橙色。 (你想只使用
    cloudflare DNS,而不是DNS +代理


Just recently deployed an Phoenix Application that runs just fine on the localhost.

The domain name is something.ai and I would like to make anyone trying to use the www version to be redirected to the non-www version.

All the DNS is being managed on CloudFlare's free plan.

Worth noting that I'm using https and SSL, everything has been properly configured on Heroku.

For some weird reason I keep getting a "too many redirects" error, although everything seems to be properly set.

解决方案

I was having exactly the same problem. Follow these steps:

  1. under "Page Rules", remove or disable any forwarding rules you might have
  2. if you're using SSL on Heroku, make sure that your cloudflare dns settings are using .herokudns.com
  3. in cloudflare under "DNS", under the "status" column, make sure your clouds are gray and not orange. (you want to only use the cloudflare DNS, not DNS + proxy

这篇关于使用SSL和CloudFlare将Phoenix应用程序部署到Heroku“太多重定向”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆