2014-11-15 103 views
0

我对Rails4应用程序使用托管服务(而非heroku)。Rails4:如何在生产中使用HTTP而不是HTTPS(SSL)

我可以搭载托管服务的SSL证书,以运行在Heroku等托管服务域上的应用程序。

浏览器在使用自定义域名(例如www.example.com)后显示警告消息。

当我输入www.example.com时,重定向到https://www.example.com(SSL)。

请告诉我如何使用HTTP://www.example.com中,而不是HTTPS的://www.example.com中(SSL)。

到目前为止,我不想为我的域购买和配置SSL证书。

我注释掉了config.force_ssl = true in production.rb。

配置\ production.rb

SampleApp::Application.configure do 
    #config.force_ssl = true 
    config.serve_static_assets = true 
end 

回答

1

尝试用 '假' 的,而不是注释掉:

config.force_ssl = false 
+0

它没有任何区别。默认值是'false'。 –

+0

感谢您的评论,@Yasin和@Simone Carletti。它在将其保存在'\ config \ environments \ production.rb'内,并保存在'\ config \ production.rb'中后可以工作。该文件保存在错误的路径中。 – SamuraiBlue

相关问题