Redirect to custom page for /hub/spawn

Hello,

I would like to redirect to custom url or page when coming to spawn page (/hub/spawn). I have checked default_url concept. Not helped

Can you explain how it “hasn’t helped”? What have you tried, and what behaviour are you expecting? Can you give us an example of the exact behaviour you’d like to see?

Hello @manics,

Im using Rest API to start the server and create it also. So, I have separate app with backend which start or spawn the JupyterHub Server using rest api. I would like to redirect to my app when i click hub/spawn instead of JupyterHub UI is spawning it.

  1. Current Problem is once the JupyterHub Server is started, it works fine without problem and proxy is redirecting it as excepted.
  2. After sometime if i don’t use the server JupyterHub will auto cull idle server.
  3. If i have access the url i.e (/user/server). It will redirect to /hub/spawn since the server is not running.
  4. My requirement is instead its redirecting to /hub/spawn. i would like to redirect to custom page and i will use REST API to start the server

Please let me know if you need further information

If you are using a reverse proxy like nginx or Apache infront of your app, maybe using Rewrite magic to redirect to your custom page whenever hub attempts to redirect to /hub/spawn can be a solution?

Hello @mahendrapaipuri ,
That could also works. But i would like to override in JupyterHub python code.

Spawning servers is arguably the primary purpose of the JupyterHub web interface, so it wouldn’t make much sense for it to be overridable.

Since you effectively want a custom UI for spawning servers you may be better off running JupyterHub in API only mode:

And maintaining your own interface.

1 Like

Okay Thanks a lot @manics , I will explain to my team