gpt4 book ai didi

ruby-on-rails - Rails Heroku SSL https ://redirect

转载 作者:行者123 更新时间:2023-12-04 06:30:06 27 4
gpt4 key购买 nike

我有一个添加了 Heroku 的 SSL 的 Rails 5 应用程序。 www.example.com 和 example.com 工作正常,但是当我以“https://”开头我的网站时,它不起作用,但“http://”有效。

我的 DNS 使用 Namecheap.com。如何让“https://example.com ”指向我的heroku应用程序?

最佳答案

你需要做的是:

您需要将 SSL Endpoint 插件添加到您的 heroku 应用程序中

它将为您的 heroku 应用程序提供 EndPoint URL

https://devcenter.heroku.com/articles/ssl-endpoint

并且您需要添加从第三方供应商处带来的 SSL cert 配置。

然后您可以使用来自 CNAME 插件的给定 EndPoint URL 添加 SSL Endpoint 记录。

确保在 config/environments/production.rb 中添加这个

config.force_ssl = true

然后它会起作用。

关于ruby-on-rails - Rails Heroku SSL https ://redirect,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40560278/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com