加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – Cloudflare上的Heroku自定义域:重定向太多

发布时间:2020-12-16 23:32:16 所属栏目:百科 来源:网络整理
导读:目标 通过Cloudflare运行https://rapid.essbap.org. 这应该映射到https://ebcc-rrn.herokuapp.com(Rails应用程序) 但是,我得到“太多重定向”页面,例如 之前在其他Heroku应用程序上成功完成此操作,使用以下步骤 我错过了什么? 我做了什么 通过Godaddy购买了
目标

>通过Cloudflare运行https://rapid.essbap.org.
>这应该映射到https://ebcc-rrn.herokuapp.com(Rails应用程序)
>但是,我得到“太多重定向”页面,例如

>之前在其他Heroku应用程序上成功完成此操作,使用以下步骤
>我错过了什么?

我做了什么

>通过Godaddy购买了essbap.org.
>导入DNS到Cloudflare.
>在Godaddy插入Cloudflare名称服务器.
>从Godaddy删除了区域记录.

CloudFlare的:

>快速插入CNAME记录指向ebcc-rrn.herokuapp.com
>在Heroku上:将自定义域名rapid.essbap.org添加到ebcc-rrn.herokuapp.com

Heroku的:

heroku domains:add rapid.essbap.org

=== ebcc-rrn Heroku Domain
ebcc-rrn.herokuapp.com

=== ebcc-rrn Custom Domains
Domain Name       DNS Target
----------------  ----------------------
rapid.essbap.org  ebcc-rrn.herokuapp.com 

$host rapid.essbap.org 
rapid.essbap.org has address 104.27.162.137 
rapid.essbap.org has address 104.27.163.137

Cloudflare设置

刚刚添加:

跑步卷曲

当我对另一个我认识有效的Heroku自定义域应用程序运行curl时,它看起来像:

$curl -I some.custom_app.com
HTTP/1.1 301 Moved Permanently
Location: https://some.custom_app.com/

# since I'm using force_ssl on Rails,we expect to be directed to https://

$curl -I https://some.custom_app.com/
HTTP/1.1 200 OK

ebcc-rrn.herokuapp.com的类似行为(Herokuapp我们希望rapid.essbap.org成为别名).一个301然后200.

但是当我对rapid.essbap.org进行curl时,我得到:

$curl -I rapid.essbap.org
HTTP/1.1 301 Moved Permanently
Location: https://rapid.essbap.org/

# since I'm using force_ssl on Rails,we expect to be directed to https://

$curl -I https://rapid.essbap.org
HTTP/1.1 301 Moved Permanently
Location: https://rapid.essbap.org/

在第二种情况下,我们得到301而不是200.我不确定为什么要生成301.不会在dev或ebcc-rrn.herokuapp.com中发生.

我错过了什么?

解决方法

不幸的是,没有确凿的解决方案(但非常感谢Heroku的技术帮助).

通过回滚并再次尝试来管理以解决问题:

>将DNS转发回Godaddy
>从Cloudflare擦除域名
>确保Godaddy的功能
>在Cloudflare上创建域
>再次转移到Cloudflare

现在一切按计划进行.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读