Welcome! Log In Create A New Profile

Advanced

Re: Reverse-proxying: Flask app with Bokeh server on Nginx

Francis Daly
May 12, 2017 04:48PM
On Fri, May 12, 2017 at 04:28:12PM +0200, J K via nginx wrote:

Hi there,

> > 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/'

> 1. in '/etc/nginx/sites-available/default' I added a new location as follow:
>
> location /bokeh/ {
>
> proxy_pass http://127.0.0.1:5006; # you suggested 127.0.
> *1*.1, but I figured that was a typo

The proxy_pass address should be wherever your "bokeh" http server is
actually listening.

Which probably means that whatever you use up there...

> command=/opt/envs/virtual/bin/bokeh serve company_abc.py company_xyz.py
> geomorphix.py --prefix=/bokeh/ --allow-websocket-origin=www.example.com
> --allow-websocket-origin=example.com --host=138.197.132.46:5006
> --use-xheaders

you should also use up there as --host.

I suspect that making them both be 127.0.0.1 will be the easiest
way of reverse-proxying things; but I also suspect that the
"--allow-websocket-origin" part suggests that you may want to configure
nginx to reverse proxy the web socket connection too. Notes are at
http://nginx.org/en/docs/http/websocket.html

It will be helpful to have a very clear picture of what talks to what,
when things are working normally; that should make it easier to be
confident that the same links are in place with nginx in the mix.

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Reverse-proxying: Flask app with Bokeh server on Nginx

J K via nginx May 12, 2017 05:12AM

Re: Reverse-proxying: Flask app with Bokeh server on Nginx

Reinis Rozitis May 12, 2017 06:34AM

Re:Reverse-proxying: Flask app with Bokeh server on Nginx

J K via nginx May 12, 2017 10:30AM

Re: Re:Reverse-proxying: Flask app with Bokeh server on Nginx

Reinis Rozitis May 12, 2017 11:28AM

Re: Re:Reverse-proxying: Flask app with Bokeh server on Nginx

Reinis Rozitis May 12, 2017 11:34AM

Re: Reverse-proxying: Flask app with Bokeh server on Nginx

Francis Daly May 12, 2017 04:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 137
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready