Hello, I have set up JupyterHub in a Kubernetes cluster, running alongside a Django application.
In my Kubernetes configuration, I’ve defined a custom configuration file (jupyter_server_config.py
) to manage server proxies. Specifically, I’ve configured a server named ‘viewer’ with certain settings, including a base URL of ‘https://apps.domain.com/hub’.
extraFiles:
custom_config:
mountPath: /usr/local/etc/jupyter/jupyter_server_config.py
stringData: |
c = get_config()
c.ServerProxy.servers = {
'viewer': {
'command': [
'python',
'manage.py',
'runserver',
'0.0.0.0:7777',
],
'port': 7777,
'absolute_url': False,
'base_url':'https://apps.domain.com/hub'
},
}
In my Django application’s settings, I’ve configured FORCE_SCRIPT_NAME
to be ‘/viewer’. However, when I navigate through the app by clicking buttons, the URLs are incorrect. For example, I’m getting https://apps.domain.com/viewer/projectadd
instead of the expected https://apps.domain.com/hub/user/<user>/viewer/projectadd
.
How can I ensure that the URLs generated are correct and include the intended base URL (https://apps.domain.com/hub/user/<user>/
)?