{"action":"created","issue":{"url":"https://api.github.com/repos/jupyter/jupyterhub/issues/289","labels_url":"https://api.github.com/repos/jupyter/jupyterhub/issues/289/labels{/name}","comments_url":"https://api.github.com/repos/jupyter/jupyterhub/issues/289/comments","events_url":"https://api.github.com/repos/jupyter/jupyterhub/issues/289/events","html_url":"https://github.com/jupyter/jupyterhub/issues/289","id":102246724,"number":289,"title":"Setting JupyterHub.hub_prefix and JupyterHub.base_url Causes 404s","user":{"login":"brunobeltran","id":1475390,"avatar_url":"https://avatars.githubusercontent.com/u/1475390?v=3","gravatar_id":"","url":"https://api.github.com/users/brunobeltran","html_url":"https://github.com/brunobeltran","followers_url":"https://api.github.com/users/brunobeltran/followers","following_url":"https://api.github.com/users/brunobeltran/following{/other_user}","gists_url":"https://api.github.com/users/brunobeltran/gists{/gist_id}","starred_url":"https://api.github.com/users/brunobeltran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunobeltran/subscriptions","organizations_url":"https://api.github.com/users/brunobeltran/orgs","repos_url":"https://api.github.com/users/brunobeltran/repos","events_url":"https://api.github.com/users/brunobeltran/events{/privacy}","received_events_url":"https://api.github.com/users/brunobeltran/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-20T21:59:23Z","updated_at":"2015-08-20T23:51:16Z","closed_at":null,"body":"On login, the url that the user is redirected to appears to be `$base_url/$hub_prefix`. Sorry for the noise if this is intended behavior, but something is definitely fishy.\r\n\r\nFor example, say I would like to put the whole application at `/lenovo/jupyterhub/`, and the hub at `/lenovo/jupyterhub/hub/`. I'm not a web developer, so I'm not sure whether the correct answer is to set \r\n`$base_url = '/lenovo/jupyterhub/'` and `$hub_prefix = '/hub/'`\r\nor \r\n`$base_url = '/lenovo/jupyterhub/'` and `$hub_prefix = '/lenovo/jupyterhub/hub/'`\r\nbut neither work, and it's not clear from trying to explore how the default URL rewriting works what was the intended behavior.\r\n\r\nFor example, with `$base_url = '/lenovo/jupyterhub/'` and `$hub_prefix = '/hub/'`, then if I'm logged in via PAM as bbeltr1, the only URL that forwards correctly is `/hub/user/bbeltr1`\r\n\r\n`https://localhost/hub/user/bbeltr1`\r\n\r\nredirects to\r\n\r\n`https://localhost/lenovo/jupyterhub/user/bbeltr1/tree`\r\n\r\nwhereas, after whatever service that takes care of `/tree/` has spawned\r\n\r\n`https://localhost/`\r\n\r\nredirects to\r\n\r\n`https://localhost/hub/lenovo/jupyterhub/user/bbeltr1`\r\n\r\nand\r\n\r\n`https://localhost/hub/`\r\n\r\nredirects to the same URL,\r\n\r\n`https://localhost/hub/lenovo/jupyterhub/user/bbeltr1`,\r\n\r\nwhich of course does not exist.\r\n\r\nOn the other hand, with `$base_url = '/lenovo/jupyterhub/'` and `$hub_prefix = '/lenovo/jupyterhub/hub/'`, I get the behavior that I expect (`/lenovo/jupyterhub/hub/user/bbeltr1` forwards to `/lenovo/jupyterhub/user/bbeltr1/tree`), but (here's a weird one), `/lenovo/jupyterhub/user/bbeltr1` forwards to `/hub/eltr1` (sic).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jupyter/jupyterhub/issues/comments/133214522","html_url":"https://github.com/jupyter/jupyterhub/issues/289#issuecomment-133214522","issue_url":"https://api.github.com/repos/jupyter/jupyterhub/issues/289","id":133214522,"user":{"login":"minrk","id":151929,"avatar_url":"https://avatars.githubusercontent.com/u/151929?v=3","gravatar_id":"","url":"https://api.github.com/users/minrk","html_url":"https://github.com/minrk","followers_url":"https://api.github.com/users/minrk/followers","following_url":"https://api.github.com/users/minrk/following{/other_user}","gists_url":"https://api.github.com/users/minrk/gists{/gist_id}","starred_url":"https://api.github.com/users/minrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minrk/subscriptions","organizations_url":"https://api.github.com/users/minrk/orgs","repos_url":"https://api.github.com/users/minrk/repos","events_url":"https://api.github.com/users/minrk/events{/privacy}","received_events_url":"https://api.github.com/users/minrk/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T23:51:16Z","updated_at":"2015-08-20T23:51:16Z","body":"Are you using latest master?"}}