jupyterhub-deploy-docker icon indicating copy to clipboard operation
jupyterhub-deploy-docker copied to clipboard

Wired Redirect Loop

Open rgentz opened this issue 7 years ago • 0 comments

Hello I am using this script trying to set up a jupyterhub in a subfolder (/j/ of a domain and am getting a wired redirect loop.

What i have done: set up nginx as reverse proxy as described in: https://jupyterhub.readthedocs.io/en/stable/reference/config-proxy.html where i just the folder /j/ to forward to jupyterhub (
location ~/j/ { proxy_pass http://mydomain:8000; .... }

Then I set up the base URL in the jupyter config c.JupyterHub.base_url = u'/j/'

I can log into the system but then i get stuck in a redirect loop. I also notice that the docker spawner never seem to have picked up the base_url, but not sure on this. [I 2018-10-30 20:37:35.682 JupyterHub app:1906] JupyterHub is now running at http://:8000/j/ [I 2018-10-30 20:37:39.182 JupyterHub log:158] 302 GET /j/ -> /j/hub (@198.128.193.134) 2.00ms [I 2018-10-30 20:37:39.192 JupyterHub log:158] 302 GET /j/hub -> /j/hub/ (@198.128.193.134) 1.03ms [I 2018-10-30 20:37:39.230 JupyterHub log:158] 302 GET /j/hub/ -> /j/user/rgentz/ ([email protected]) 26.96ms [I 2018-10-30 20:37:39.261 JupyterHub log:158] 302 GET /j/user/rgentz/ -> /j/hub/user/rgentz/ (@198.128.193.134) 1.15ms [W 2018-10-30 20:37:39.295 JupyterHub dockerspawner:125] DockerSpawner.container_image is deprecated in dockerspawner 0.9. Use DockerSpawner.image [I 2018-10-30 20:37:39.344 JupyterHub dockerspawner:452] Container 'jupyter-rgentz' is gone [I 2018-10-30 20:37:39.448 JupyterHub dockerspawner:540] Created container 'jupyter-rgentz' (id: 9e9f5db) from image jupyterhub-user [I 2018-10-30 20:37:39.448 JupyterHub dockerspawner:557] Starting container 'jupyter-rgentz' (id: 9e9f5db) [I 2018-10-30 20:37:41.111 JupyterHub log:158] 200 GET /j/hub/api (@172.18.0.4) 2.23ms [I 2018-10-30 20:37:42.426 JupyterHub base:628] User rgentz took 3.130 seconds to start [I 2018-10-30 20:37:42.427 JupyterHub proxy:242] Adding user rgentz to proxy /j/user/rgentz/ => http://172.18.0.4:8888 20:37:42.429 - info: [ConfigProxy] Adding route /j/user/rgentz -> http://172.18.0.4:8888 20:37:42.430 - info: [ConfigProxy] 201 POST /api/routes/j/user/rgentz [I 2018-10-30 20:37:42.432 JupyterHub log:158] 302 GET /j/hub/user/rgentz/ -> /j/user/rgentz/?redirects=1 ([email protected]) 3149.93ms [I 2018-10-30 20:37:42.459 JupyterHub log:158] 302 GET /j/user/rgentz/?redirects=1 -> /j/hub/user/rgentz/?redirects=1 (@198.128.193.134) 1.16ms [I 2018-10-30 20:37:42.468 JupyterHub log:158] 302 GET /j/user/rgentz/?redirects=1 -> /j/hub/user/rgentz/?redirects=1 (@198.128.193.134) 1.12ms [W 2018-10-30 20:37:42.512 JupyterHub base:1101] Redirect loop detected on /j/hub/user/rgentz/?redirects=1 [I 2018-10-30 20:37:44.515 JupyterHub log:158] 302 GET /j/hub/user/rgentz/?redirects=1 -> /j/user/rgentz/?redirects=2 ([email protected]) 2041.74ms [I 2018-10-30 20:37:44.528 JupyterHub log:158] 302 GET /j/user/rgentz/?redirects=2 -> /j/hub/user/rgentz/?redirects=2 (@198.128.193.134) 1.16ms [W 2018-10-30 20:37:44.597 JupyterHub base:1101] Redirect loop detected on /j/hub/user/rgentz/?redirects=2 [I 2018-10-30 20:37:48.600 JupyterHub log:158] 302 GET /j/hub/user/rgentz/?redirects=2 -> /j/user/rgentz/?redirects=3 ([email protected]) 4037.30ms [I 2018-10-30 20:37:48.622 JupyterHub log:158] 302 GET /j/user/rgentz/?redirects=3 -> /j/hub/user/rgentz/?redirects=3 (@198.128.193.134) 1.13ms [W 2018-10-30 20:37:48.668 JupyterHub base:1101] Redirect loop detected on /j/hub/user/rgentz/?redirects=3 [I 2018-10-30 20:37:56.672 JupyterHub log:158] 302 GET /j/hub/user/rgentz/?redirects=3 -> /j/user/rgentz/?redirects=4 ([email protected]) 8032.12ms [I 2018-10-30 20:37:56.699 JupyterHub log:158] 302 GET /j/user/rgentz/?redirects=4 -> /j/hub/user/rgentz/?redirects=4 (@198.128.193.134) 1.36ms [W 2018-10-30 20:37:56.766 JupyterHub web:1667] 500 GET /j/hub/user/rgentz/?redirects=4 (198.128.193.134): Redirect loop detected. [E 2018-10-30 20:37:56.810 JupyterHub log:150] { "X-Real-Ip": "123.123.123.123", "Host": "mydomain", "X-Forwarded-For": "123.123.123.123", "Connection": "close", "Upgrade-Insecure-Requests": "1", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36", "Dnt": "1", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "Accept-Encoding": "gzip, deflate, br", "Accept-Language": "en-US,en;q=0.9", "Cookie": "jupyterhub-hub-login=\"2|1:0|10:1540929280|20:jupyterhub-hub-login|xxxx\"; __cfduid=xxx; grafana_sess=xxx; jupyterhub-session-id=xxx" }

rgentz avatar Oct 30 '18 20:10 rgentz