如何在bokeh 0.12.5上启用SSL/HTTPS? [英] How to enable SSL/HTTPS on bokeh 0.12.5?

查看:82
本文介绍了如何在bokeh 0.12.5上启用SSL/HTTPS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个简单的Bokeh应用程序,该应用程序可以通过bokeh服务成功运行.然后,我被问到是否可以使用HTTPS重新部署它.客户端已经具有SSL证书,并且只能在其Intranet中访问该应用程序.大多数搜索结果是针对Apache或Nginx等代理服务器后面的部署的.是我们设置SSL所必需的吗?可以在Bokeh上本地完成吗?

I have created a simple Bokeh app that runs successfully via bokeh serve. I was then asked whether it could be re-deployed using HTTPS instead. The client already has an SSL certificate, and the app is only accessed within their intranet. Most search results are for deployments behind a proxy server like Apache or Nginx. Are those required for us to setup SSL? Can it be done on Bokeh natively?

推荐答案

Bokeh Server没有内置的SSL功能.如果需要,您将需要在可以终止SSL连接的代理(如Nginx)后面进行部署.在《用户指南》部分

Bokeh Server does not have any SSL capability built in. If you want that, you will need to deploy behind a proxy such as Nginx that can terminate the SSL connections. There is a description of the setup required in te User's Guide section Reverse Proxying with Nginx and SSL. The gist is that you need to start the Bokeh server itself with the --use-xheaders option, and then have an Nginx config similar to:

location / {
        proxy_pass http://127.0.0.1:5100;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host:$server_port;
        proxy_buffering off;
    }

其他代理只要也可以代理websocket,很可能也会工作.

It's probably the case that other proxies will work as well, as long as they can also proxy websockets.

这篇关于如何在bokeh 0.12.5上启用SSL/HTTPS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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