Reverse-proxying: Flask app with Bokeh server on Nginx

Reinis Rozitis r at
Fri May 12 15:26:39 UTC 2017

>  3. in the Flask app, I changed the URL 
> to:url=''
> Now, when I open the app in the browser I get a 502 Bad Gateway, and the 
> Flask log file says the following:
> raise IOError("Cannot pull session document because we failed to connect 
> to the server (to start the server, try the 'bokeh serve' command)")

Well seems that the Flask app uses the url also for background requests.

You can't mix 'https://' and :5006 port  in same url - this way the request 
goes to port 5006 but it expects to be also encrypted but if I understand 
correctly bokeh doesn't support SSL.

p.s. for best performance you could tweak that the Flask->bokeh requests go 
through http but for the html template/output sent to clients there is 
another variable or relative paths.


More information about the nginx mailing list