如何让 Sinatra 通过 HTTPS/SSL 工作? [英] How to make Sinatra work over HTTPS/SSL?

查看:30
本文介绍了如何让 Sinatra 通过 HTTPS/SSL 工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所说,谷歌没有提供任何关于此的有用信息.

As the title says, Google doesn't give anything useful concerning this.

如何为 Sinatra 应用设置和配置 HTTPS/SSL?

How do I set up and configure HTTPS/SSL for Sinatra apps?

如何创建 HTTPS 路由?

How do I create a HTTPS route?

我以前从未在我的应用程序中使用过 HTTPS,也没有调整 Rack/任何东西的经验,所以我感谢详细的答案.

I have never used HTTPS for my apps before and have no experience tweaking Rack/whatever, so I appreciate detailed answers.

推荐答案

我想您需要设置您的 Web 服务器,而不是 Sinatra,才能使用 SSL.在 Sinatra 中,您可以使用 request.secure? 方法来检查 SSL 使用情况.

I guess you need to setup your Web-server, not Sinatra, to work with SSL. In Sinatra you can use the request.secure? method to check for the SSL usage.

SSL + Nginx:第一篇第二个.

SSL + Nginx: the first article, the second one.

这篇关于如何让 Sinatra 通过 HTTPS/SSL 工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆