“config.force_ssl = true”不强制使用 HTTPS
我正在运行 Rails 3.1 并尝试将上述行放入development.rb 和 application.rb (不是同时),但它似乎没有做任何事情。我的请求仍在 HTTP 上运行。这不是意味着强制所有请求都使用 HTTPS 吗?我确信我在这里错过了一些非常明显的东西,但我一生都无法想到什么 - 作为新手也无济于事。
任何帮助将不胜感激。
干杯, 丹妮.
I am running Rails 3.1 and have tried putting the above line in development.rb and application .rb (not both at the same time) but it doesn't seem to do anything. My request are still working on HTTP. Isn't this meant to force all requests to use HTTPS? I'm sure I've missed something very obvious here but can't for the life of me think of what - being a newbie doesn't help either.
Any help would be greatly appreciated.
Cheers,
Dany.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
本地不行,你部署了吗?
It wont work locally, have you deployed it?
只要您的本地服务器(webrick?)配置为使用 SSL,它就会工作,下面是通过 script/rails 实现此目的的一种方法:
It will work provided that your local server (webrick?) is configured to use SSL, below is one way to do that via
script/rails
: