Jupyterhub baseUrl Help needed please

I am new to Jupyterhub space and i am working on a usecase of deploying jupyterhub on an AKS Cluster.
i want to open jupyterhub when i try to access domain-name.com/nap. For making this happen, I installed nginx ingress in AKS cluster and routed /nap to proxy-public:80. In config.yaml file, I added hub.baseUrl: /nap. I checked the svc logs and browser devTools and found out that the request is not triggering /hub or /hub/spawn.
While installing the helm chart, i am setting a page.html file as set file in b64 encoding format as this file is needed while startup (this file is being called in hub.extrafiles.page_html).

Am i missing updating /nap in any other place as well? or could it be due to html file which i am setting.

Can you share the configuration of your NGINX ingress? I believe that JupyterHub has it own ingress.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hub-ingress
  namespace: default
  labels:
    velero.io/backup-name: backup-2025-09-07-08-26-18
    velero.io/restore-name: restore-2025-09-11-09-52-36
spec:
  ingressClassName: nginx
  rules:
  - http:
      paths:
      - path: /nap
        pathType: Prefix
        backend:
          service:
            name: proxy-public
            port:
              number: 80

This is the ingress i was applying.

Since you’re using Z2JH you should set the hub.baseUrl configuration property, since multiple K8s resources need to be modified.

i have already added the hub.baseurl: /nap. Are there any other places i need to change? or are there any direct changes i have to do in other resources.

In the Z2JH Helm chart you should only set hub.baseUrl, you shouldn’t configure the base URL anywhere else. Since you’re using an ingress you should set ingress.enabledand a class name or annotations instead of creating it yourself.

If you’re still having problems can you share your full Z2JH configuration, including any customisations or extra K8S resources that you’ve created?

Thanks for the input, Sorry. I am afraid i cannot share the config here as it is company proprietory. Please let me know if u want to look into any specific section, i can help u accordingly Also, i am trying to create the ingress section in config and getting the error:

ingress:
enabled: true

hosts:

- host: app-nap.domain.com

  paths:

    - path: /nap

      pathType: Prefix  

annotations:

kubernetes.io/ingress.class: "nginx"

nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"

nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"

nginx.ingress.kubernetes.io/configuration-snippet: proxy_set_header X-Forwarded-Prefix /nap;

error:
Error: UPGRADE FAILED: failed to create resource: Ingress.networking.k8s.io “jupyterhub” is invalid: spec.rules[0].host: Invalid value: “map[host:app-nap.domain.com paths:[map[path:/nap pathType:Prefix]]]”: a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, ‘-’ or ‘.’, and must start and end with an alphanumeric character (e.g. ‘example.com’, regex used for validation is ‘[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*’)

ingress.hosts should be a list of hostnames, see

Your shouldn’t specify paths, this is handled by the helm chart.

Thanks a lot @manics , your inputs helped a lot but i am facing another issue.
so basically, from a high level view - when using launch jupyterhub from iframe, it basically triggers the domain.com/logout first and then autologins using /login endpoint and re-directs to /hub and /hub/spawn because of the settings we maintain in Configuration. This is the case it is working fine without any path-based routing.

But due to /nap endpoint routing, the redirection from /logout is not going to /login and getting stuck in endless loop.

It is not redirecting the way it has to. Can you please help?

It sounds like it’s something to do with your customisations. Can you share your JupyterHub logs? Can you also try removing all customisations so you’re running a plain Z2JH but with your baseurl, then work out which of your customisations breaks things?

As i already mentioned, we are using jupyterhub from iframe. So, from our main application when we click on project name - it auto-logins to iframe JH due to auto_login enabled.

So, i was checking the hub’s logs and found the following logs whenever i am trying to click on project in source application:

I also have another aks cluster where the JH is working with baseUrl as \ and it doesn’t have this error. (screenshot in next comment)

Please let me know if we are searching for a specific error log, i can ping that as well.

Edit: Forgot to mention, if i give domain-name.com/nap/hub i can see the jupyterhub server starting but it doesn’t start if triggering as iframe from source app.

logs from another hub which is running with / baseurl

It’s hard to know what’s going on without seeing the rest of your configuration. Can you try my earlier suggestion:

1 Like