如何让 Sinatra 通过 HTTPS/SSL 工作? [英] How to make Sinatra work over 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: the first article, the second one.
这篇关于如何让 Sinatra 通过 HTTPS/SSL 工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!