JupyterHub extra_services. 404 Error when trying to access app

I have the following problem: I want to add a custom Tornado Service to my JupyterHub Service, which runs on an OpenShift Cluster inside a Pod.

I found a similar issue here, which could help to solve our problem: How to set up the jupyterhub services?

c.JupyterHub.services = [
    {"name": "aboutservice",
        "command": [sys.executable, "/usr/local/bin/aboutservice.py"],
        "url": "",

The app is a very simple Tornado Hello World example.

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        html = "<html><body><h1>Hello, world</h1></body></html>"

async def main():
    application = tornado.web.Application(
            (r"/", MainHandler),
    await asyncio.Event().wait()

if __name__ == "__main__":

The ConfixProxy adds the service as so:

13:30:12.005 [ConfigProxy] info: Route added /services/aboutservice ->

However, the URL mapping seems to be wrong.

“Server at responded with 404”

Shouldn´t the extra service on port 8888 being mapped to ?

Does anyone know what we are doing wrong? Thank you for any help!

Curling it works fine:

sh-4.4$ curl
<html><body><h1>Hello, world</h1></body></html>sh-4.4$ ^C

Your service needs to take into account the URL prefix added by JupyterHub. If you try curl you should see the same error.

Your service can find out the URL prefix from some environment variables set by JupyterHub, see Services — JupyterHub 3.1.1 documentation

1 Like