rails 中的部分 SSL [英] Partial SSL in rails
问题描述
我希望在 rails 中创建一个部分 SSL 站点.我基本上想保护 SSL 背后的用户操作,但仅此而已.
I'm looking to do a partial SSL site in rails. I basically want to protect the user actions behind SSL, but nothing else.
有谁知道有什么插件或 gem 可以让这一切变得简单高效?
Anyone know of a plugin or gem that makes this simple and efficient?
推荐答案
这通常通过 SSL 要求插件.它设置了 before_filter
s,允许您指定哪些操作需要 SSL,哪些可以选择允许,哪些不允许.
This is typically done with the SSL Requirement plugin. It sets up before_filter
s allowing you to specify which actions require SSL and which optionally allow it, and which specifically do not allow it.
除此之外,只需在您的 Apache(或您使用的任何服务器)配置中设置 2 个 VHost,一个用于 SSL 站点,另一个用于非 SSL 站点.
Outside of that, it's just a matter of setting up 2 VHosts in your Apache (or whichever server you use) configuration, one for the SSL site and one for the non-SSL site.
这篇关于rails 中的部分 SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!