jupyter / dashboards_server

[RETIRED] Server that runs and renders Jupyter notebooks as interactive dashboards
Other
181 stars 48 forks source link

Failed to run with Apache proxy #312

Open etikhomolov opened 7 years ago

etikhomolov commented 7 years ago

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 commented 7 years ago

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

etikhomolov commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

jhpedemonte commented 7 years ago

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

--BASE_URL='[/jd]'