dashboards_server icon indicating copy to clipboard operation
dashboards_server copied to clipboard

Failed to run with Apache proxy

Open etikhomolov opened this issue 8 years ago • 6 comments

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)

etikhomolov avatar Jan 19 '17 23:01 etikhomolov

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

parente avatar Jan 20 '17 12:01 parente

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

etikhomolov avatar Jan 20 '17 17:01 etikhomolov

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.

parente avatar Jan 21 '17 02:01 parente

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>

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

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

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

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

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

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

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

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

etikhomolov avatar Jan 21 '17 02:01 etikhomolov

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

etikhomolov avatar Jan 21 '17 03:01 etikhomolov

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

--BASE_URL='[/jd]'

jhpedemonte avatar Mar 01 '17 23:03 jhpedemonte