【发布时间】:2014-03-02 17:40:06
【问题描述】:
所以我在让我的 rails 应用程序在 https 上运行时遇到了一些问题。我只是试图缩小导致问题的可能性。
我想知道我是否遗漏了配置 Rails 应用程序本身(不是 Web 服务器)的任何步骤:
-
在
config/environments/production.rb取消注释此行:
config.force_ssl = true来源:http://simonecarletti.com/blog/2011/05/configuring-rails-3-https-ssl/
-
Devise gem 的附加配置
在
config/environments/production.rb添加以下行:
config.to_prepare { Devise::SessionsController.force_ssl } config.to_prepare { Devise::RegistrationsController.force_ssl } config.to_prepare { Devise::PasswordsController.force_ssl }来源:https://github.com/plataformatec/devise/wiki/How-To:-Use-SSL-%28HTTPS%29
我还缺少其他步骤吗?目前,我在尝试访问我的服务器时看到“此网页不可用”消息,但在 Web 服务器或 Rails 应用程序的日志文件中没有看到任何错误。
我在网络浏览器中看到此错误消息:Error code: ERR_CONNECTION_REFUSED
谢谢
【问题讨论】:
-
根据您的github.com/plataformatec/devise/wiki/… 链接,您是否为 ssl 配置了服务器?
标签: ssl https devise ruby-on-rails-3.2