Make it possible to use relative URLs
See original GitHub issueI’m trying to get bokeh running in a docker/docker-swarm behind a nginx with path to port mapping. Unfortunately bokeh produces full URL’s when creating links which doesn’t work in my case.
Starting bokeh with:
bokeh serve untitled.py --host=* --disable-index-redirect
And accessing it over:
https://my.bokeh.server:8443/9335bf292e454cf8ba1181befd4d4a99/p5006/
Produce links like the following:
<link rel="stylesheet" href="http://127.0.0.1:5006/static/css/bokeh.min.css?v=7246afcfffc127faef7c138bce4742e9" type="text/css" />
I’ve tried setting the explicit --host
and also tried the --prefix
option, both doesn’t fit my requirements. What would work is a possibility to switch using relative URL’s. Means instead of http://127.0.0.1:5006/static/
use ./static/
or even better static/
. This is the same approach that shiny Apps are using.
For the websocket it could be calculated on the client side
var protocol = 'ws:';
if (window.location.protocol === 'https:')
protocol = 'wss:';
// TODO check for '/' in pathname and pathname is not already decoded
var defaultPath = window.location.pathname + '/websocket/';
var ws = new WebSocket(protocol + '//' + window.location.host + defaultPath);
So my enhancement is:
Please, make it possible to enable relative URL generation. For example with --use-relative-urls
See also https://groups.google.com/a/continuum.io/forum/#!topic/bokeh/lIrCvXZE18M
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (12 by maintainers)
Top GitHub Comments
if removing --host btw it might be friendly to accept it and do nothing (maybe with deprecation message) rather than throwing an error.
@bryevdv @havocp Thanks for your comments and for the great work. Using relative URLs plus remove the host header will make bokeh setup very easy. Looking forward to test it.