在 Rails 3.0 中配置 Webrick 以同时提供 http 和 https (SSL)

发布于 2024-12-14 13:25:02 字数 390 浏览 4 评论 0原文

我正在尝试在我的应用程序中使用 Rails 3.0 的 ssl_requiremnt 插件。我的应用程序中的一些链接需要使用 SSL 来保证安全,其余的则需要仅通过 http 提供服务。我根据这篇文章配置了webrick: http://www.nearinfinity.com/blogs/chris_rohr /configuring_webrick_to_use_ssl.html

现在我希望 webrick 同时提供 http 和 https 服务。使用 Rails 2.3 似乎很容易。

有人可以帮我吗?

I am trying to use ssl_requiremnt plugin for rails 3.0 in my app. A few links in my app need to be secure with SSL and the rest need to be served by http only. I configured webrick according to this post: http://www.nearinfinity.com/blogs/chris_rohr/configuring_webrick_to_use_ssl.html

Now I want webrick to serve both http and https. It seems it was easy with rails 2.3.

Could someone please help me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

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

评论(1

对岸观火 2024-12-21 13:25:02

我通过切换 Nginx 解决了这个问题,但使用 Webrick 却无法做到这一点。我猜 Webrick 不支持同时服务器的两个实例,要切换,您需要停止当前服务器并重新启动具有 https:// 设置的服务器。

I solved the issue by switching Nginx but could not do it using Webrick. I guess Webrick does not support two instances of a server simultaneously and to switch you need to stop the current server and restart the server which has got https:// settings.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文