From dd1c0c7ac26101abfa1d144e4c325eeabde906ea Mon Sep 17 00:00:00 2001 From: George Hunt Date: Wed, 10 Mar 2021 17:35:48 +0000 Subject: [PATCH] getting nginx proxy to work /jupyterhub --- roles/jupyter/templates/jupyter-nginx.conf | 20 ++++++++++++++++++++ roles/jupyter/templates/jupyterhub_config.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 roles/jupyter/templates/jupyter-nginx.conf diff --git a/roles/jupyter/templates/jupyter-nginx.conf b/roles/jupyter/templates/jupyter-nginx.conf new file mode 100644 index 000000000..a9d450c10 --- /dev/null +++ b/roles/jupyter/templates/jupyter-nginx.conf @@ -0,0 +1,20 @@ +location /jupyterhub { + proxy_pass http://127.0.0.1:8000; + proxy_set_header X-Real-IP $remote_addr; + #proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + + + # websocket headers + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + #proxy_set_header Connection $connection_upgrade; + proxy_set_header X-Scheme $scheme; + + proxy_buffering off; + } + # Managing requests to verify letsencrypt host + location ~ /.well-known { + allow all; + } diff --git a/roles/jupyter/templates/jupyterhub_config.py b/roles/jupyter/templates/jupyterhub_config.py index cd0999ca1..ade964254 100644 --- a/roles/jupyter/templates/jupyterhub_config.py +++ b/roles/jupyter/templates/jupyterhub_config.py @@ -124,7 +124,7 @@ c.JupyterHub.authenticator_class = 'firstuseauthenticator.FirstUseAuthenticator' # .. deprecated: 0.9 # Use JupyterHub.bind_url # Default: '/' -# c.JupyterHub.base_url = '/' +# c.JupyterHub.base_url = '/jupyterhub' ## The public facing URL of the whole JupyterHub application. #