Cull_idle_servers doesn't appear to be functioning correctly when a base_url is set

I’m having an issue using the culling option with my JupyterHub.

Apologies I can’t paste in all of my code as I don’t have it right now, but I’ll do my best to explain the situation

I am using an Nginx proxy from a seperate server using a location block and a proxy_pass

location /jupyter { 
  ... 
}

In my custom helm chart I am setting:

hub:
  extraConfig:
    baseUrl: |
      c.JupyterHub.base_url = '/jupyter'

This works fine as a user on the front end. I can access https://mydomain/jupyter and it will redirect me to login and everything works as normal.

When I turn on culling,

cull: 
  maxAge: 3600 
  cullEvery: 60

Everything on the front end still works fine, but in the kubectl logs for the hub pod I can see I’m getting an error whenever it tries to do the culling check. There’s a line that has (forgive me, this is off the top of my head) 302: /hub/api/users -> /jupyter/hub/hub/api/users

This then throws some other errors which I can’t completely remember but I’m pretty sure the cause is that it can’t get to /jupyter/hub/hub/api/users as there is an extra /hub in there.

Any suggestions as to what is going here? Has anyone else used a base_url and Nginx as a reverse proxy with a matching location block?

Thanks.

1 Like