Bokeh Serve HTTPS instead of HTTP

时光毁灭记忆、已成空白 提交于 2019-12-11 06:07:53

问题


How to use HTTPS instead of HTTP for Bokeh Serve ?

The command I use is: bokeh serve --port 8000

I'm using an Amazon EC2 with a docker container (exposed and forwarded port 8000, everything works with HTTP). With a Jupyter notebok you can for example use a certfile to allow HTTPS traffic: --certfile=/.keys/mycert.pem


回答1:


EDIT: The old answer is obsolete. As of Bokeh 1.4, you can terminate SSL directly on the Bokeh server (no Nginx required):

https://docs.bokeh.org/en/latest/docs/user_guide/server.html#ssl-termination



From the docs... https://docs.bokeh.org/en/latest/docs/user_guide/server.html

Include in your nginx.conf :

# redirect HTTP traffic to HTTPS (optional)
server {
    listen      80;
    server_name foo.com;
    return      301 https://$server_name$request_uri;
}

and run the serve command with --use-x-headers flag

bokeh serve myapp.py --port 8000 --use-xheaders

This tutorial might be helpful: https://blog.docker.com/2015/04/tips-for-deploying-nginx-official-image-with-docker/



来源:https://stackoverflow.com/questions/49862782/bokeh-serve-https-instead-of-http

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!