Partial SSL in rails

Partial SSL in rails

私藏温柔 发布于 2021-11-30 字数 205 浏览 810 回复 3 原文

I'm looking to do a partial SSL site in rails. I basically want to protect the user actions behind SSL, but nothing else.

Anyone know of a plugin or gem that makes this simple and efficient?

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你的背包 2022-06-07 3 楼

ssl_routes gem defines ssl enforcement rule in the route file. It also will automatically output the url with the correct protocol to prevent redirects.

天涯离梦残月幽梦 2022-06-07 2 楼

You can try ssl_requirement. It lets you specify what you want.

舞袖。长 2022-06-07 1 楼

This is typically done with the SSL Requirement plugin. It sets up before_filters allowing you to specify which actions require SSL and which optionally allow it, and which specifically do not allow it.

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.