Reverse-proxying: Flask app with Bokeh server on Nginx

Reinis Rozitis r at roze.lv
Fri May 12 10:33:16 UTC 2017


> I understand that I might have to use a method called reverse proxying, 
> which is described here. However, I wasn't able to get it to work.

Well you already do this "method called reverse proxying" with the Flask app 
so you have to do the same with the Bokeh app as all modern/current browsers 
require all resources on a HTTPS website to be also loaded through secure 
channels.


> Does anybody have an idea how to solve this? A similar problem was 
> described here.

You can basically copy the configuration from the SO thread you linked 
(obviously you can change the location names as you wish / they just need to 
match):

In nginx add:

location /bokeh/ {
    proxy_pass http://127.0.1.1:5006;

    # .. with the rest of directives
}

relaunch the Bokeh app with

--prefix=/bokeh/

and (if takes part in the url construction rather than application 
background requests) change the url variable in the Flask app

url='http://###.###.###.##:5006'
to
url='https://yourserver/bokeh/'

or even just relative url='/bokeh/' .. (I'm not familiar with this software 
stack so you have to test yourself)


rr 



More information about the nginx mailing list