Server_document() generated script not working with reverse proxy


I am struggling with embedding a bokeh server in an html document using the script generated by server_document(). The symptom is a 404 not found error on autoload.js when trying to access the app over a reverse proxy. I’d love some suggestions…


Software: Apache 2.4.6, Bokeh 2.0.1, CentOS 7.7

This works (direct): server_document (url=“”)

This fails (reverse proxy): server_document (“",relative_urls=True,resources="default”)

Error reported by bokeh server:

2020-04-21 12:29:32,328 404 GET …autoload.js …

I’m not sure what can be said from that brief description, except to note that the proxy will need to be configured to allow the path that is 404’ing, so that the page can load BokehJS from the Bokeh server. Alternatively, if it is an option in your situation, you could specify that the server should configure CDN resources, instead of serving BokehJS itself. I typically do that with an env var:


Naturally, any viewer will need to have public internet access to for this option.