Flask app with bokeh and reverse proxy

Hey

I’m running bokeh server, flask app and client hosted in nginx all on the same server.

Bokeh server

server = Server({'/bk_app': sliders_modify_doc},
                io_loop=IOLoop(),
                prefix='/bk',
                allow_websocket_origin=["localhost:1337", "localhost:8080", "localhost:80"])

server.start()
server.io_loop.start()

``

Flask app

@app.route('/bokeh')
def get():
    script = server_document('/bk/bk_app', relative_urls=True, arguments=request.args)
    return render_template("bokeh.html", script=script, template="Flask")

``

I configured the nginx to redirect every request starting with ‘bk’ to the bokeh server.

All files are loading as expected, but the WebSocket is stuck as pending.

(nginx is running on port 8080)

Am I missing something?

Thanks

Hi,

It's not really possible to say anything specific without seeing your nginx config. For instance, did you also configure nginx to proxy websockets? This is a separate thing that must be explicitly done (there's an example in the docs)

Thanks,

Bryan

···

On Apr 12, 2018, at 06:36, [email protected] wrote:

Hey
I'm running bokeh server, flask app and client hosted in nginx all on the same server.

Bokeh server
server = Server({'/bk_app': sliders_modify_doc},
                io_loop=IOLoop(),
                prefix='/bk',
                allow_websocket_origin=["localhost:1337", "localhost:8080", "localhost:80"])

server.start()
server.io_loop.start()

Flask app
@app.route('/bokeh')
def get():
    script = server_document('/bk/bk_app', relative_urls=True, arguments=request.args)
    return render_template("bokeh.html", script=script, template="Flask")

I configured the nginx to redirect every request starting with 'bk' to the bokeh server.
All files are loading as expected, but the WebSocket is stuck as pending.

(nginx is running on port 8080)

Am I missing something?
Thanks

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/6af69ab2-67b8-4ad6-afa3-03cfcc7bb8dd%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.