【问题标题】:force_ssl working for http://www.domain.com but not http://domain.comforce_ssl 适用于 http://www.domain.com 但不适用于 http://domain.com
【发布时间】:2013-01-07 04:17:31
【问题描述】:

http://www.domain.com 转发到https://www.domain.com 但是http://domain.com 不会转发到https://domain.com

我正在使用 nginx 和 unicorn,有没有办法在 Rails 中解决这个问题?还是需要更改 nginx/unicorn 设置?

【问题讨论】:

    标签: ruby-on-rails nginx unicorn


    【解决方案1】:

    您可以使用https://github.com/stjhimy/rack-www 将所有请求重定向到 www 域。

    config.middleware.use Rack::WWW, :www => true
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-15
      • 1970-01-01
      • 1970-01-01
      • 2018-10-26
      • 2019-02-28
      • 2015-01-05
      • 2018-07-20
      • 2013-11-30
      相关资源
      最近更新 更多