Deploying Phoenix Application to Heroku with SSL and CloudFlare “too many redirects”

此生再无相见时 提交于 2019-12-11 06:55:59

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/43141495/deploying-phoenix-application-to-heroku-with-ssl-and-cloudflare-too-many-redire

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!