为 HTTPS 显示制作脚本内容 'safe' (Bokeh)

Making script content 'safe' for HTTPS display (Bokeh)

我在寻找解决方案时遇到了 google 从 maria saz. Fortunately, I was able to see it cached 中删除的问题。由于我有完全相同的问题,所以我借用了原文:

""" 我正在使用内联嵌入构建一个带有散景图的网站。但是,使用 https 连接到站点会阻止渲染图,因为源被视为 'unauthenticated'。有办法解决吗?

在'Security Overview'中,它说:

Blocked mixed content Your page requested insecure resources that were blocked.

两个被阻止的请求是:

bokeh-0.12.1.min.css

bokeh-0.12.1.min.js

... """

就我而言,我可以添加一些进一步的信息。该站点正在使用 django 和 google 应用程序引擎构建,如果我允许不安全的内容,散景图将按预期工作。

我怎样才能提供我的内容,以便脚本在没有警告的情况下加载?

如果您在终止 SSL 的代理后面代理 Bokeh 服务器,则需要配置代理以将原始协议传递到 Bokeh 服务器,并使用 --use-xheaders 命令行选项调用 Bokeh 服务器:

bokeh serve app_script.py --use-xheaders

无法告诉您如何转发协议,因为您尚未指定您的设置是什么,但用户指南中有 Nginx 和 SSL 的示例:

http://docs.bokeh.org/en/latest/docs/user_guide/server.html#reverse-proxying-with-nginx-and-ssl

通过使用 "https://"

引用 CDN 地址即可解决此问题

bokeh embed notes