Serve Bokeh apps with jupyterHub behind Apache reverse proxy

I have an instance of JupyterHub running using oauth same user spawner. The environment is running with Apache as reverse proxy and ssl. My http conf file is set up to enable websocket connections and everything works. I have a bokeh server running in a virtual env. I can start the server but can not reach the page via the browser. I can embed inline bokeh apps in a notebook served by JupyterHub, but I can not get the notebook to have a webpage spawn after the show() function is called. I have tried to use the bokeh docs in the JupyterHub section and the apache config section but they aren’t very in depth. Are there any detailed examples of how to get this scenario running, thank you.

Sorry not to see this earlier. I don’t think it really makes sense to run the Bokeh server within a Jupyter environment like this, unless it is inline directly within a notebook.

The notebook servers are managed by JupyterHub which allocates a new port for each new Jupyter server to run on. JupyterHub’s main role is to proxy through to each of those Jupyter servers, so if you access the URL /user/dan/ it proxies through to the Jupyter server running on the pre-agreed port.

If a Bokeh server is run independently within the Jupyter server for example, there is no easy way to tell JupyterHub to add a proxy mapping to that new server’s arbitrary port.

To run Bokeh apps easily within JupyterHub, I would recommend trying out my open source project ContainDS Dashboards. This is an extension which means you can upload/edit your Bokeh scripts within the Jupyter environment, or just specify a Git URL to the code, and then it automatically spins up a new Bokeh-only server to display your app. This is accessible to any authenticated JupyterHub user (or you can restrict to specific users if you prefer).

Please take a look and let me know if you have any questions. This page should give you an idea of the userflow for deploying a Bokeh app once ContainDS Dashboards is set up on your JupyterHub:

Hey Dan, this was from me (Omar) you worked with me a few weeks ago to get ContainDs set up, it’s been working great so far.

How funny - I didn’t recognise your username…! Great to hear that ContainDS Dashboards is still working well for you.

Let me know any feedback by email once you get a chance to use it properly in your work!

If any Bokeh-specific questions make more sense on this forum, please send me a link or tag me too.