Skip to content
This repository has been archived by the owner on Oct 26, 2019. It is now read-only.

Failed to run with Apache proxy #312

Open
etikhomolov opened this issue Jan 19, 2017 · 6 comments
Open

Failed to run with Apache proxy #312

etikhomolov opened this issue Jan 19, 2017 · 6 comments

Comments

@etikhomolov
Copy link

Everything works fine in localhost mode. But when I set remote connection from the browser and redirection in Apache I get:

Failed to create kernel: API request failed (404): Not Found

jupyter kernelgateway is running locally and listening to http://127.0.0.1:8888 as it was in localhost mode.

jupyter-dashboards-server starts as:

jupyter-dashboards-server --KERNEL_GATEWAY_URL=http://127.0.0.1:8888 --TRUST_PROXY=true --BASE_URL=/jd

Browser console has the following:

POST http://hlaweb.triumf.ca/api/kernels?1484866275414 404 (Not Found)

@parente
Copy link
Member

parente commented Jan 20, 2017

What URL are you visiting to load the dashboard in your browser?

@etikhomolov
Copy link
Author

http://hlaweb.triumf.ca/jd

And I configured Apache to redirect /jd to http://127.0.0.1:9988
Redirection itself works fine but the dashboard is not running because of API error

@parente
Copy link
Member

parente commented Jan 21, 2017

I'm looking at the POST to http://hlaweb.triumf.ca/api/kernels?1484866275414 in your report. It's missing the /jd prefix.

Can you share your apache proxy config? When you say it's "redirecting" do you really mean proxying or is it truly redirecting the user's browser (e.g., with a 301 or 302) which won't work

For what it's worth,
https://github.com/jupyter-incubator/dashboards_server/blob/e248cf7b1344bbccc87d16d45e4bedae0bf0dcab/etc/nginx/nginx.vh.default.conf is a contributed nginx proxy config for reference.

@etikhomolov
Copy link
Author

My httd.conf contains the following:
####################################################################################

Jupyter Dashboard Sever

####################################################################################
<Location /jd>
ProxyPass http://127.0.0.1:9988/
ProxyPassReverse http://127.0.0.1:9988/
RequestHeader set Origin "http://127.0.0.1:9988"

<Location /components>
ProxyPass http://127.0.0.1:9988/components
ProxyPassReverse http://127.0.0.1:9988/components

<Location /css>
ProxyPass http://127.0.0.1:9988/css
ProxyPassReverse http://127.0.0.1:9988/css

<Location /dashboards>
ProxyPass http://127.0.0.1:9988/dashboards
ProxyPassReverse http://127.0.0.1:9988/dashboards

<Location /static>
ProxyPass http://127.0.0.1:9988/static
ProxyPassReverse http://127.0.0.1:9988/static

<Location /login>
ProxyPass http://127.0.0.1:9988/login
ProxyPassReverse http://127.0.0.1:9988/login

<Location /tree>
ProxyPass http://127.0.0.1:9988/tree
ProxyPassReverse http://127.0.0.1:9988/tree

<Location /kernelspecs/>
ProxyPass ws://127.0.0.1:9988/kernelspecs/
ProxyPassReverse ws://127.0.0.1:9988/kernelspecs/
ProxyAddHeaders On
ProxyPreserveHost On

<Location /api/kernels/>
ProxyPass ws://127.0.0.1:9988/api/kernels/
ProxyPassReverse ws://127.0.0.1:9988/api/kernels/
ProxyAddHeaders On
ProxyPreserveHost On

@etikhomolov
Copy link
Author

Apache version:
httpd-2.4.6-45.el7.centos.x86_64

@jhpedemonte
Copy link
Collaborator

If you don't want the /jd prefix on the dashboard side, then you'd need to specify it like his:

--BASE_URL='[/jd]'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants