# DockerSpawner breaks with 302 response from unmodified jupyterhub/jupyterhub-deploy-docker.git repo

**URL:** <https://discourse.jupyter.org/t/dockerspawner-breaks-with-302-response-from-unmodified-jupyterhub-jupyterhub-deploy-docker-git-repo/21061>\
**Category:** JupyterHub\
**Tags:** jupyterhub, help-wanted\
**Created:** [August 25, 2023, 12:14am UTC](https://discourse.jupyter.org/t/dockerspawner-breaks-with-302-response-from-unmodified-jupyterhub-jupyterhub-deploy-docker-git-repo/21061 "2023-08-25T00:14:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![toby-tobkin](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/toby-tobkin/32/10805_2.png) [@toby-tobkin](https://discourse.jupyter.org/u/toby-tobkin)\
**Post date:** [August 25, 2023, 12:14am UTC](https://discourse.jupyter.org/t/dockerspawner-breaks-with-302-response-from-unmodified-jupyterhub-jupyterhub-deploy-docker-git-repo/21061/1 "2023-08-25T00:14:06Z")

</div>

Hi JupyterHub community,

I am trying to deploy JupyterHub with DockerSpawner to a fresh Ubuntu 22 LTS VM, however I am running into problems.

**Can someone give me a pointer to how I may debug this? Should I file an issue with the jupyterhub Github repo, or might it be an issue with my administration?**

**Expected Behavior:** After installation, I can signup and login with the admin account  
**Actual Behavior:** When logging in, I get a 302 redirect back to the login screen and no JupyterLab environment is created using DockerSpawner.

Steps taken:  
**1. Create a fresh Ubuntu 22 LTS VM on Digital Ocean and login**

```auto
ssh xxx.xxx.xxx.xxx

```

**2. Run `install-docker.sh`**

```auto
#!/bin/bash

# Instructions from https://docs.docker.com/engine/install/ubuntu/

sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update

sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-compose

```

**3. Clone the official `jupyterhub-deploy-docker` repo**

```auto
git clone https://github.com/jupyterhub/jupyterhub-deploy-docker.git

```

**4. Build and run the Docker image per the `README.md`**

```auto
cd jupyterhub-deploy-docker/basic-example
docker-compose build
docker-compose up

```

**5. Navigate to JupyterHub in my web browser and attempt the signup + login workflow**  
First, I navigate to the JupyterHub server. Next, I click “sign up”. I sign up with either username/password of admin/password or toby/password. Then, I go back to the login screen. Next, I login with one of the username/password combos. Finally, I get redirected straight back to the login screen with a 302 HTTP response.

So, I cannot get to JupyterLab ☹

The content of the JupyterHub Docker container logs from startup to redirect are below:

```auto
root@indieagi-jupyterhub-droplet:~/jupyterhub-deploy-docker/basic-example# docker-compose up                                            
Creating network "jupyterhub-network" with the default driver                                                                           
Creating volume "basic-example_jupyterhub-data" with default driver
Creating jupyterhub ... done
Attaching to jupyterhub
jupyterhub | [I 2023-08-24 23:53:27.988 JupyterHub app:2859] Running JupyterHub version 4.0.2
jupyterhub | [I 2023-08-24 23:53:27.989 JupyterHub app:2889] Using Authenticator: nativeauthenticator.nativeauthenticator.NativeAuthenticator
jupyterhub | [I 2023-08-24 23:53:27.989 JupyterHub app:2889] Using Spawner: dockerspawner.dockerspawner.DockerSpawner-12.1.0
jupyterhub | [I 2023-08-24 23:53:27.989 JupyterHub app:2889] Using Proxy: jupyterhub.proxy.ConfigurableHTTPProxy-4.0.2
jupyterhub | [I 2023-08-24 23:53:28.005 JupyterHub app:1709] Writing cookie_secret to /data/jupyterhub_cookie_secret
jupyterhub | [I 2023-08-24 23:53:28.048 alembic.runtime.migration migration:213] Context impl SQLiteImpl.
jupyterhub | [I 2023-08-24 23:53:28.048 alembic.runtime.migration migration:216] Will assume non-transactional DDL.
jupyterhub | [I 2023-08-24 23:53:28.063 alembic.runtime.migration migration:621] Running stamp_revision -> 0eee8c825d24
jupyterhub | [I 2023-08-24 23:53:28.330 JupyterHub proxy:556] Generating new CONFIGPROXY_AUTH_TOKEN
jupyterhub | [W 2023-08-24 23:53:28.366 JupyterHub auth:37] 
jupyterhub | The shared database session at Authenticator.db is deprecated, and will be removed.
jupyterhub | Please manage your own database and connections.
jupyterhub |     
jupyterhub | Contact JupyterHub at https://github.com/jupyterhub/jupyterhub/issues/3700
jupyterhub | if you have questions or ideas about direct database needs for your Authenticator.
jupyterhub |     
jupyterhub | [I 2023-08-24 23:53:28.377 JupyterHub roles:238] Adding role admin for User: admin
jupyterhub | [I 2023-08-24 23:53:28.386 JupyterHub roles:238] Adding role user for User: admin
jupyterhub | [I 2023-08-24 23:53:28.392 JupyterHub app:1984] Not using allowed_users. Any authenticated user will be allowed.
jupyterhub | [I 2023-08-24 23:53:28.420 JupyterHub app:2928] Initialized 0 spawners in 0.003 seconds
jupyterhub | [I 2023-08-24 23:53:28.427 JupyterHub metrics:278] Found 0 active users in the last ActiveUserPeriods.twenty_four_hours
jupyterhub | [I 2023-08-24 23:53:28.429 JupyterHub metrics:278] Found 0 active users in the last ActiveUserPeriods.seven_days
jupyterhub | [I 2023-08-24 23:53:28.430 JupyterHub metrics:278] Found 0 active users in the last ActiveUserPeriods.thirty_days
jupyterhub | [W 2023-08-24 23:53:28.430 JupyterHub proxy:746] Running JupyterHub without SSL. I hope there is SSL termination happening somewhere else...
jupyterhub | [I 2023-08-24 23:53:28.430 JupyterHub proxy:750] Starting proxy @ http://:8000
jupyterhub | 23:53:28.731 [ConfigProxy] info: Proxying http://*:8000 to (no default)
jupyterhub | 23:53:28.735 [ConfigProxy] info: Proxy API at http://127.0.0.1:8001/api/routes
jupyterhub | 23:53:28.902 [ConfigProxy] info: 200 GET /api/routes 
jupyterhub | [I 2023-08-24 23:53:28.903 JupyterHub app:3178] Hub API listening on http://jupyterhub:8080/hub/
jupyterhub | 23:53:28.905 [ConfigProxy] info: 200 GET /api/routes 
jupyterhub | [I 2023-08-24 23:53:28.905 JupyterHub proxy:477] Adding route for Hub: / => http://jupyterhub:8080
jupyterhub | 23:53:28.907 [ConfigProxy] info: Adding route / -> http://jupyterhub:8080
jupyterhub | 23:53:28.908 [ConfigProxy] info: Route added / -> http://jupyterhub:8080
jupyterhub | 23:53:28.908 [ConfigProxy] info: 201 POST /api/routes/ 
jupyterhub | [I 2023-08-24 23:53:28.909 JupyterHub app:3245] JupyterHub is now running at http://:8000
jupyterhub | [I 2023-08-24 23:53:34.526 JupyterHub log:191] 302 GET / -> /hub/ (@::ffff:98.210.128.78) 1.27ms
jupyterhub | [I 2023-08-24 23:53:34.590 JupyterHub log:191] 302 GET /hub/ -> /hub/login?next=%2Fhub%2F (@::ffff:98.210.128.78) 0.88ms
jupyterhub | [I 2023-08-24 23:53:34.677 JupyterHub log:191] 200 GET /hub/login?next=%2Fhub%2F (@::ffff:98.210.128.78) 28.16ms
jupyterhub | [I 2023-08-24 23:53:40.737 JupyterHub log:191] 200 GET /hub/signup (@::ffff:98.210.128.78) 11.94ms
jupyterhub | [I 2023-08-24 23:53:47.695 JupyterHub log:191] 302 GET / -> /hub/ (@::ffff:64.180.89.191) 0.92ms
jupyterhub | [I 2023-08-24 23:53:47.753 JupyterHub log:191] 302 GET /hub/ -> /hub/login?next=%2Fhub%2F (@::ffff:64.180.89.191) 0.82ms
jupyterhub | [I 2023-08-24 23:53:47.805 JupyterHub log:191] 200 GET /hub/login?next=%2Fhub%2F (@::ffff:64.180.89.191) 1.64ms
jupyterhub | [W 2023-08-24 23:53:54.756 JupyterHub base:843] Failed login for admin
jupyterhub | [I 2023-08-24 23:53:54.758 JupyterHub log:191] 200 POST /hub/login?next=%2Fhub%2F (@::ffff:64.180.89.191) 5.69ms
jupyterhub | [W 2023-08-24 23:53:58.037 JupyterHub base:843] Failed login for admin
jupyterhub | [I 2023-08-24 23:53:58.039 JupyterHub log:191] 200 POST /hub/login?next=%2Fhub%2F (@::ffff:64.180.89.191) 4.11ms
jupyterhub | [I 2023-08-24 23:53:59.886 JupyterHub log:191] 200 GET /hub/signup (@::ffff:64.180.89.191) 1.91ms
jupyterhub | [I 2023-08-24 23:54:06.286 JupyterHub log:191] 200 POST /hub/signup (@::ffff:64.180.89.191) 294.40ms
jupyterhub | [I 2023-08-24 23:54:08.597 JupyterHub log:191] 200 GET /hub/login (@::ffff:64.180.89.191) 3.81ms
jupyterhub | [I 2023-08-24 23:54:13.767 JupyterHub base:837] User logged in: admin
jupyterhub | [I 2023-08-24 23:54:13.771 JupyterHub log:191] 302 POST /hub/login?next= -> /hub/spawn (admin@::ffff:64.180.89.191) 293.63ms
jupyterhub | [I 2023-08-24 23:54:13.823 JupyterHub log:191] 302 GET /hub/spawn -> /hub/login?next=%2Fhub%2Fspawn (@::ffff:64.180.89.191) 1.94ms
jupyterhub | [I 2023-08-24 23:54:13.875 JupyterHub log:191] 200 GET /hub/login?next=%2Fhub%2Fspawn (@::ffff:64.180.89.191) 3.21ms
jupyterhub | 23:58:28.912 [ConfigProxy] info: 200 GET /api/routes 
jupyterhub | 00:03:28.912 [ConfigProxy] info: 200 GET /api/routes 
jupyterhub | 00:08:28.911 [ConfigProxy] info: 200 GET /api/routes 
jupyterhub | [I 2023-08-25 00:09:34.265 JupyterHub log:191] 200 GET /hub/login (@::ffff:98.210.128.78) 1.86ms
jupyterhub | [I 2023-08-25 00:09:37.582 JupyterHub base:837] User logged in: admin
jupyterhub | [I 2023-08-25 00:09:37.583 JupyterHub log:191] 302 POST /hub/login?next= -> /hub/spawn (admin@::ffff:98.210.128.78) 279.89ms
jupyterhub | [I 2023-08-25 00:09:37.644 JupyterHub log:191] 302 GET /hub/spawn -> /hub/login?next=%2Fhub%2Fspawn (@::ffff:98.210.128.78) 0.82ms
jupyterhub | [I 2023-08-25 00:09:37.705 JupyterHub log:191] 200 GET /hub/login?next=%2Fhub%2Fspawn (@::ffff:98.210.128.78) 1.65ms

```

---

<div class="post-metadata">

**Author:** ![minrk](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/minrk/32/13_2.png) [@minrk](https://discourse.jupyter.org/u/minrk)\
**Post date:** [August 28, 2023, 7:16am UTC](https://discourse.jupyter.org/t/dockerspawner-breaks-with-302-response-from-unmodified-jupyterhub-jupyterhub-deploy-docker-git-repo/21061/2 "2023-08-28T07:16:53Z")

</div>

You might check your content or tracker prevention settings in your browser, because it seems like something is blocking the jupyterhub login cookie. Perhaps the browser console will shed some light. Maybe try in a private window or other browser. These are the logs I get from running your steps:

> ****
>
> ```auto
> jupyterhub | [I 2023-08-28 07:10:35.738 JupyterHub app:2859] Running JupyterHub version 4.0.2
> jupyterhub | [I 2023-08-28 07:10:35.738 JupyterHub app:2889] Using Authenticator: nativeauthenticator.nativeauthenticator.NativeAuthenticator
> jupyterhub | [I 2023-08-28 07:10:35.738 JupyterHub app:2889] Using Spawner: dockerspawner.dockerspawner.DockerSpawner-12.1.0
> jupyterhub | [I 2023-08-28 07:10:35.738 JupyterHub app:2889] Using Proxy: jupyterhub.proxy.ConfigurableHTTPProxy-4.0.2
> jupyterhub | [I 2023-08-28 07:10:35.760 JupyterHub app:1709] Writing cookie_secret to /data/jupyterhub_cookie_secret
> jupyterhub | [I 2023-08-28 07:10:35.794 alembic.runtime.migration migration:213] Context impl SQLiteImpl.
> jupyterhub | [I 2023-08-28 07:10:35.794 alembic.runtime.migration migration:216] Will assume non-transactional DDL.
> jupyterhub | [I 2023-08-28 07:10:35.803 alembic.runtime.migration migration:621] Running stamp_revision -> 0eee8c825d24
> jupyterhub | [I 2023-08-28 07:10:35.946 JupyterHub proxy:556] Generating new CONFIGPROXY_AUTH_TOKEN
> jupyterhub | [W 2023-08-28 07:10:35.961 JupyterHub auth:37]
> jupyterhub | The shared database session at Authenticator.db is deprecated, and will be removed.
> jupyterhub | Please manage your own database and connections.
> jupyterhub |
> jupyterhub | Contact JupyterHub at https://github.com/jupyterhub/jupyterhub/issues/3700
> jupyterhub | if you have questions or ideas about direct database needs for your Authenticator.
> jupyterhub |
> jupyterhub | [I 2023-08-28 07:10:35.965 JupyterHub roles:238] Adding role admin for User: admin
> jupyterhub | [I 2023-08-28 07:10:35.971 JupyterHub roles:238] Adding role user for User: admin
> jupyterhub | [I 2023-08-28 07:10:35.975 JupyterHub app:1984] Not using allowed_users. Any authenticated user will be allowed.
> jupyterhub | [I 2023-08-28 07:10:35.993 JupyterHub app:2928] Initialized 0 spawners in 0.003 seconds
> jupyterhub | [I 2023-08-28 07:10:35.999 JupyterHub metrics:278] Found 0 active users in the last ActiveUserPeriods.twenty_four_hours
> jupyterhub | [I 2023-08-28 07:10:36.000 JupyterHub metrics:278] Found 0 active users in the last ActiveUserPeriods.seven_days
> jupyterhub | [I 2023-08-28 07:10:36.001 JupyterHub metrics:278] Found 0 active users in the last ActiveUserPeriods.thirty_days
> jupyterhub | [W 2023-08-28 07:10:36.001 JupyterHub proxy:746] Running JupyterHub without SSL. I hope there is SSL termination happening somewhere else...
> jupyterhub | [I 2023-08-28 07:10:36.001 JupyterHub proxy:750] Starting proxy @ http://:8000
> jupyterhub | 07:10:36.363 [ConfigProxy] info: Proxying http://*:8000 to (no default)
> jupyterhub | 07:10:36.365 [ConfigProxy] info: Proxy API at http://127.0.0.1:8001/api/routes
> jupyterhub | 07:10:36.450 [ConfigProxy] info: 200 GET /api/routes
> jupyterhub | [I 2023-08-28 07:10:36.455 JupyterHub app:3178] Hub API listening on http://jupyterhub:8080/hub/
> jupyterhub | 07:10:36.456 [ConfigProxy] info: 200 GET /api/routes
> jupyterhub | [I 2023-08-28 07:10:36.456 JupyterHub proxy:477] Adding route for Hub: / => http://jupyterhub:8080
> jupyterhub | 07:10:36.457 [ConfigProxy] info: Adding route / -> http://jupyterhub:8080
> jupyterhub | 07:10:36.458 [ConfigProxy] info: Route added / -> http://jupyterhub:8080
> jupyterhub | [I 2023-08-28 07:10:36.458 JupyterHub app:3245] JupyterHub is now running at http://:8000
> jupyterhub | 07:10:36.458 [ConfigProxy] info: 201 POST /api/routes/
> jupyterhub | [I 2023-08-28 07:11:00.437 JupyterHub log:191] 302 GET / -> /hub/ (@::ffff:172.19.0.1) 3.52ms
> jupyterhub | [W 2023-08-28 07:11:00.452 JupyterHub base:415] Invalid or expired cookie token
> jupyterhub | [I 2023-08-28 07:11:00.453 JupyterHub log:191] 302 GET /hub/ -> /hub/login?next=%2Fhub%2F (@::ffff:172.19.0.1) 2.00ms
> jupyterhub | [I 2023-08-28 07:11:00.487 JupyterHub log:191] 200 GET /hub/login?next=%2Fhub%2F (@::ffff:172.19.0.1) 24.33ms
> jupyterhub | [I 2023-08-28 07:11:01.545 JupyterHub log:191] 302 GET /hub/home -> /hub/login?next=%2Fhub%2Fhome (@::ffff:172.19.0.1) 2.84ms
> jupyterhub | [I 2023-08-28 07:11:01.572 JupyterHub log:191] 200 GET /hub/login?next=%2Fhub%2Fhome (@::ffff:172.19.0.1) 1.20ms
> jupyterhub | [W 2023-08-28 07:11:13.202 JupyterHub base:843] Failed login for test
> jupyterhub | [I 2023-08-28 07:11:13.204 JupyterHub log:191] 200 POST /hub/login?next=%2Fhub%2Fhome (@::ffff:172.19.0.1) 20.96ms
> jupyterhub | [I 2023-08-28 07:11:15.329 JupyterHub log:191] 200 GET /hub/signup (@::ffff:172.19.0.1) 11.83ms
> jupyterhub | [I 2023-08-28 07:11:21.276 JupyterHub log:191] 200 POST /hub/signup (@::ffff:172.19.0.1) 279.83ms
> jupyterhub | [I 2023-08-28 07:11:30.484 JupyterHub log:191] 200 GET /hub/login (@::ffff:172.19.0.1) 6.87ms
> jupyterhub | [I 2023-08-28 07:11:34.310 JupyterHub roles:238] Adding role user for User: test
> jupyterhub | [I 2023-08-28 07:11:34.322 JupyterHub base:837] User logged in: test
> jupyterhub | [I 2023-08-28 07:11:34.323 JupyterHub log:191] 302 POST /hub/login?next= -> /hub/spawn (test@::ffff:172.19.0.1) 285.65ms
> jupyterhub | [I 2023-08-28 07:11:34.356 JupyterHub provider:659] Creating oauth client jupyterhub-user-test
> jupyterhub | [I 2023-08-28 07:11:34.392 JupyterHub dockerspawner:1218] pulling image jupyter/base-notebook:latest
> jupyterhub | [I 2023-08-28 07:11:35.348 JupyterHub log:191] 302 GET /hub/spawn -> /hub/spawn-pending/test (test@::ffff:172.19.0.1) 1010.92ms
> jupyterhub | [I 2023-08-28 07:11:35.385 JupyterHub pages:398] test is pending spawn
> jupyterhub | [I 2023-08-28 07:11:35.393 JupyterHub log:191] 200 GET /hub/spawn-pending/test (test@::ffff:172.19.0.1) 11.47ms
> jupyterhub | [W 2023-08-28 07:11:44.345 JupyterHub base:1090] User test is slow to start (timeout=10)
> jupyterhub | [I 2023-08-28 07:11:53.084 JupyterHub dockerspawner:988] Container 'jupyter-test' is gone
> jupyterhub | [I 2023-08-28 07:11:53.834 JupyterHub dockerspawner:1272] Created container jupyter-test (id: 1240db4) from image jupyter/base-notebook:latest
> jupyterhub | [I 2023-08-28 07:11:53.834 JupyterHub dockerspawner:1296] Starting container jupyter-test (id: 1240db4)
> jupyterhub | [I 2023-08-28 07:11:55.924 JupyterHub log:191] 200 GET /hub/api (@172.19.0.3) 3.53ms
> jupyterhub | [I 2023-08-28 07:11:55.983 JupyterHub log:191] 200 POST /hub/api/users/test/activity (test@172.19.0.3) 39.13ms
> jupyterhub | [W 2023-08-28 07:11:56.070 JupyterHub _version:37] Single-user server has no version header, which means it is likely < 0.8. Expected 4.0.2
> jupyterhub | [I 2023-08-28 07:11:56.071 JupyterHub base:990] User test took 21.727 seconds to start
> jupyterhub | [I 2023-08-28 07:11:56.071 JupyterHub proxy:330] Adding user test to proxy /user/test/ => http://172.19.0.3:8888
> jupyterhub | 07:11:56.080 [ConfigProxy] info: Adding route /user/test -> http://172.19.0.3:8888
> jupyterhub | 07:11:56.080 [ConfigProxy] info: Route added /user/test -> http://172.19.0.3:8888
> jupyterhub | [I 2023-08-28 07:11:56.083 JupyterHub users:768] Server test is ready
> jupyterhub | [I 2023-08-28 07:11:56.084 JupyterHub log:191] 200 GET /hub/api/users/test/server/progress?_xsrf=[secret] (test@::ffff:172.19.0.1) 20544.77ms
> jupyterhub | 07:11:56.082 [ConfigProxy] info: 201 POST /api/routes/user/test
> jupyterhub | [I 2023-08-28 07:11:56.130 JupyterHub log:191] 302 GET /hub/spawn-pending/test -> /user/test/ (test@::ffff:172.19.0.1) 2.34ms
> jupyterhub | [I 2023-08-28 07:11:56.532 JupyterHub log:191] 302 GET /hub/api/oauth2/authorize?client_id=jupyterhub-user-test&redirect_uri=%2Fuser%2Ftest%2Foauth_callback&response_type=code&state=[secret] -> /user/test/oauth_callback?code=[secret]&state=[secret] (test@::ffff:172.19.0.1) 68.88ms
> jupyterhub | [I 2023-08-28 07:11:56.609 JupyterHub log:191] 200 POST /hub/api/oauth2/token (test@172.19.0.3) 51.06ms
> jupyterhub | [I 2023-08-28 07:11:56.619 JupyterHub log:191] 200 GET /hub/api/user (test@172.19.0.3) 7.56ms
> 
> ```

Note the lack of a username (it’s present before the `@` if a user is identified) in the request for `302 GET /hub/spawn`:

```auto
jupyterhub | [I 2023-08-25 00:09:37.644 JupyterHub log:191] 302 GET /hub/spawn -> /hub/login?next=%2Fhub%2Fspawn (@::ffff:98.210.128.78) 0.82ms

```

This suggests to me that the login cookie set by `/hub/login` is not being sent in the subsequent request to `/hub/spawn`, either because it’s not set correctly or something is preventing it from being set and/or sent. In my logs, you can see the username `test@` on this request, after which it proceeds with the spawn.

---

<div class="post-metadata">

**Author:** ![toby-tobkin](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/toby-tobkin/32/10805_2.png) [@toby-tobkin](https://discourse.jupyter.org/u/toby-tobkin)\
**Post date:** [August 29, 2023, 12:14am UTC](https://discourse.jupyter.org/t/dockerspawner-breaks-with-302-response-from-unmodified-jupyterhub-jupyterhub-deploy-docker-git-repo/21061/3 "2023-08-29T00:14:03Z")

</div>

> This suggests to me that the login cookie set by `/hub/login` is not being sent in the subsequent request to `/hub/spawn` , either because it’s not set correctly or something is preventing it from being set and/or sent.

@minrk I believe you may be correct. I had two further observations today:

1. I think we forgot to configure SSL on this instance
2. The login works if we use the IP address of JupyterHub to access the login screen instead of its DNS record

Will be prioritizing this soon and can update with the resolution.

---

<div class="post-metadata">

**Author:** ![toby-tobkin](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/toby-tobkin/32/10805_2.png) [@toby-tobkin](https://discourse.jupyter.org/u/toby-tobkin)\
**Post date:** [September 1, 2023, 7:34am UTC](https://discourse.jupyter.org/t/dockerspawner-breaks-with-302-response-from-unmodified-jupyterhub-jupyterhub-deploy-docker-git-repo/21061/4 "2023-09-01T07:34:48Z")

</div>

The issue was SSL configuration. To fix the issue, a friend changed the `docker-compose.yml` with the following patch. I’m unsure the patch is production-quality, but I’m open to feedback.

```auto
diff --git a/runtime-config/docker-compose.yml b/runtime-config/docker-compose.yml
index 111184a..17a8b16 100644
--- a/runtime-config/docker-compose.yml
+++ b/runtime-config/docker-compose.yml
@@ -24,8 +24,6 @@ services:
       - "/var/run/docker.sock:/var/run/docker.sock:rw"
       # Bind Docker volume on host for JupyterHub database and cookie secrets
       - "jupyterhub-data:/data"
- ports:
- - "8000:8000"
     environment:
       # This username will be a JupyterHub admin
       JUPYTERHUB_ADMIN: admin
@@ -37,6 +35,37 @@ services:
       DOCKER_NOTEBOOK_DIR: /home/jovyan/work
       # Using this run command
       DOCKER_SPAWN_CMD: start-singleuser.sh
+ labels:
+ - "traefik.enable=true"
+ # Put domain to host on between the backticks
+ - "traefik.http.routers.jupyterhub.rule=Host(`jupyter-dev.indieagi.org`)"
+ - "traefik.http.services.jupyterhub.loadbalancer.server.port=8000"
+ - "traefik.http.routers.jupyterhub.tls=true"
+ - "traefik.http.routers.jupyterhub.tls.certresolver=myresolver"
+
+
+ traefik:
+ image: "traefik:v2.10"
+ container_name: "traefik"
+ command:
+ - "--providers.docker=true"
+ - "--providers.docker.exposedbydefault=false"
+ - "--entrypoints.web.address=:80"
+ - "--entrypoints.websecure.address=:443"
+ - "--certificatesresolvers.myresolver.acme.storage=/etc/traefik/acme/acme.json"
+ # Put email here for Let's Encrypt
+ - "--certificatesresolvers.myresolver.acme.email=test@jupyter-dev.indieagi.org"
+ - "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
+ networks:
+ - jupyterhub-network
+ ports:
+ - "80:80"
+ - "443:443"
+ volumes:
+ - "/var/run/docker.sock:/var/run/docker.sock:ro"
+ - "./acme:/etc/traefik/acme" # Map acme.json to a host directory
+
+  
 
 volumes:
   jupyterhub-data:

```
