# Deploying JupyterHub behind an Apache reverse proxy’s subdirectory

JupyterHub supports deployment behind a reverse proxy and even instructs how to do so behindnginx in its manual. I was unable to find documentation about how to do this serving the content from a reverse proxy subdirectory.

Since there’s been a long time since I worked as a sysadmin and, therefore, I tend to forget these things, here hoes my documentation, in the hopes it will be useful to someone else.

Let’s assume JupterHub is running in a machine whose IP is 10.0.0.1 and, since it is being proxied, the --no-ssl command was used. Let’s also assume the Apache proxy serves its content at example.com.

<IfModule mod_proxy.c>
Redirect /jupyter /jupyter/
ProxyVia On
ProxyRequests Off
ProxyPass /jupyter/ http://10.0.0.1:8000/jupyter/
ProxyPassReverse /jupyter/ http://10.0.0.1:8000/jupyter/
ProxyPreserveHost on
<Proxy *>
</Location>
You will need the mod_proxy_wstunnel module.