Hi all.
So, I’m attempting to make bokeh-server accessible via an Nginx proxy. I’m running the server with the default options, so it listens on localhost:5006.
Then, in the nginx config, I have:
listen 443 default_server;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
server_name example.com;
location /bokeh {
proxy_cache off;
proxy_pass http://localhost:5006;
proxy_cookie_domain localhost example.com;
sub_filter 'http://localhost:5006' 'https://example.com';
}
location /static {
# .. same as above
}
It works fine if I access it via http://example:5006. Now, when I access https://example.com/bokeh I see the following output in Chome’s Javascript console:
Bokeh: setting prefix to https://example.com/ bokeh.js:68001
Bokeh: setting ws_conn_string to: ws://localhost:5007/bokeh/sub/ bokeh.js:1723
[blocked] The page at ‘https://example.com/bokeh/’ was loaded over HTTPS, but ran insecure content from ‘ws://localhost:5007/bokeh/sub/’: this content should also be loaded over HTTPS.
bokeh.js:68635
Bokeh: websocket creation failed for connection string: ws://localhost:5007/bokeh/sub/ bokeh.js:1723
Bokeh: - SecurityError: Failed to construct ‘WebSocket’: An insecure WebSocket connection may not be initiated from a page loaded over HTTPS. bokeh.js:1723
Uncaught TypeError: Cannot set property ‘onopen’ of undefined bokeh.js:68642
So, I see a few issues with this setup: a) the JS is attempting to access ws://localhost instead of ws://example.com, and b) it isn’t using a secure connection, c) It is accessing port 5007.
This is my first time configuring nginx.
Does anyone familiar with nginx or with experience proxying bokeh-server have any pointers regarding configuring nginx or any bokeh-server options to achieve proxying?
Thanks!
-David