Dan*_*May 8 dns ruby-on-rails heroku cloudflare
目标
我做了什么
essbap.org通过Godaddy 购买.CloudFlare的:
rapid指向ebcc-rrn.herokuapp.comrapid.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
Run Code Online (Sandbox Code Playgroud)
Cloudflare设置
刚刚添加:
跑步卷曲
当我curl与另一个我认识有效的Heroku自定义域应用程序运行时,它看起来像:
$ 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
Run Code Online (Sandbox Code Playgroud)
类似的行为ebcc-rrn.herokuapp.com(Herokuapp我们希望rapid.essbap.org成为别名).一个301然后200.
但是当我curl反对时rapid.essbap.org,我得到:
$ 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/
Run Code Online (Sandbox Code Playgroud)
在第二种情况下,我们得到301而不是200.我不确定为什么要生成301.不会发生在开发或与ebcc-rrn.herokuapp.com.
我错过了什么?
我最近在一个网站上遇到了同样的问题,也使用了 Heroku 和 Cloudflare 以及 SSL。
在我们的案例中,解决方案是我们必须将 Cloudflare 中的 Crypto > SSL 下的 SSL 选项设置为Flexible. 我们将其设置为Full,这导致该站点尝试使用 CloudFlare 的 SSL 证书。它不适用于 SSL 选项设置为Off.
不幸的是,没有决定性的解决方案(但非常感谢 Heroku 的技术帮助)。
设法通过回滚并重试来解决问题:
现在一切都按计划进行。
| 归档时间: |
|
| 查看次数: |
2449 次 |
| 最近记录: |