【问题标题】:All requests are http inside rails app deployed on heroku所有请求都是部署在heroku上的rails应用程序中的http
【发布时间】:2021-09-30 21:37:51
【问题描述】:

我有一个应用程序,它的 URL 是 https://example.sample.com。但是当我使用 rails logger 登录应用程序时 Rails.logger.info request.base_url 它显示http://example.sample.com。为什么会这样?

【问题讨论】:

    标签: ruby-on-rails ruby


    【解决方案1】:

    您需要确保 ssl 在您的 config/environments/production.rb 文件中使用 config.force_ssl

    config.force_ssl = true
    

    【讨论】:

      猜你喜欢
      • 2015-08-15
      • 2014-08-08
      • 1970-01-01
      • 1970-01-01
      • 2016-06-23
      • 2020-05-15
      • 2019-02-19
      • 2015-03-04
      • 2013-01-08
      相关资源
      最近更新 更多