XNAT JupyterHub behind Apache reverse proxy?

44 views
Skip to first unread message

Nadya Shusharina

unread,
Mar 1, 2023, 9:20:09 PM3/1/23
to xnat_discussion
Hi,

I am running XNAT behind an Apache proxy that provides https encryption. JupyterHub opens a notebook window but cannot launch any kernels or open terminals. I do not have other issues with XNAT behind this proxy.  On a local machine without any proxies, everything works as expected.

Is a special configuration required for JupyterHub in this setup? 

Thank you,
Nadya

Andrew Lassiter

unread,
Mar 3, 2023, 12:45:17 PM3/3/23
to xnat_discussion
Hi Nadya,

We've configured HAProxy with https but I have not tried Apache.

Here's the JupyterHub documentation for Apache with SSL:

I think you'll need to add an additional <Location "jupyterhub"> to your Apache config.

Best,
Andy

Nadya Shusharina

unread,
Mar 6, 2023, 6:14:56 PM3/6/23
to xnat_discussion
Thanks. I am running dockerized XNAT/JupyterHub, which already includes nginx to take care of the routing between XNAT and JupyterHub including port 8000.
The following Apache2 reverse https proxy configuration works with dockerized XNAT/JupyterHub behind Apache2:
ProxyPreserveHost On
RewriteEngine On
ProxyRequests off
ProxyPass / http://127.0.0.1:80/
ProxyPassReverse / http://127.0.0.1:80/
RequestHeader set X-Forwarded-Protocol "https"
Header edit Location ^http://(.*)$ https://$1
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /jupyterhub/(.*) ws://127.0.0.1/jupyterhub/$1 [P,L]
Reply all
Reply to author
Forward
0 new messages