Rutger Hofste
Rutger Hofste

Reputation: 4373

Bokeh Serve HTTPS instead of HTTP

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

Upvotes: 2

Views: 1607

Answers (1)

Lauren Oldja
Lauren Oldja

Reputation: 622

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/

Upvotes: 3

Related Questions