Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow running TLJH under a URL prefix #216

Closed
yuvipanda opened this issue Oct 29, 2018 · 4 comments · Fixed by #623
Closed

Allow running TLJH under a URL prefix #216

yuvipanda opened this issue Oct 29, 2018 · 4 comments · Fixed by #623
Labels
enhancement New feature or request

Comments

@yuvipanda
Copy link
Collaborator

Currently TLJH runs in the root of the domain (example.com), and can not easily work under a URL prefix (example.com/hub). Would be nice to support this.

Requested by @mdogy

@minrk
Copy link
Member

minrk commented Oct 30, 2018

Setting c.JupyterHub.base_url = '/jupyterhub/' should be everything that's needed for this, so I think this should just be a docs update.

@tkang007
Copy link

Hello,

Thanks. It worked correctly by setting c.JupyterHub.base_url.

How about traefik.toml for sharing with other services, such as nbviewer.

I tried as below and it worked.
pip install nbviewer at TLJH user(conda) env.
python3 -m nbviewer --localfiles=/public --port=5000

For setting based on traefik service.
It looks like possible by updating traefik.toml.tpl at soruce.

Do you have any guide for sharing traefik service ?

Thanks in advance.

@tkang007
Copy link

tkang007 commented Jan 21, 2019

Hi,

Below is my updating traefik.toml to share treafik service between jupyterhub and nbviewer.
nbviewer is an public web service based on docker container, just sharing public folders with jupyterhub by mounting the folders at the container.

[frontends]
[frontends.default]
backend = "jupyterhub"
passHostHeader = true
priority = 100
[frontends.default.routes.rule1]
rule = "Path:/;AddPrefix:/jupyterhub"

[frontends.jupyterhub]
backend = "jupyterhub"
passHostHeader = true
priority = 90
[frontends.jupyterhub.routes.rule1]
rule = "PathPrefix:/jupyterhub"

[frontends.nbviewer]
backend = "nbviewer"
passHostHeader = true
priority = 80
[frontends.nbviewer.routes.rule1]
rule = "PathPrefix:/nbviewer"

[backends]
[backends.jupyterhub]
[backends.jupyterhub.servers.chp]
url = "http://127.0.0.1:15003"

[backends.nbviewer]
[backends.nbviewer.servers.nbv]
url = "http://127.0.0.1:25000"

Welcome any better approaches.

@ikhoury
Copy link

ikhoury commented Sep 10, 2020

Hello,

I added an extra_config.py file under /opt/tljh/config/jupyterhub_config.d/ with c.JupyterHub.base_url = '/jupyter/'. However, when I run tljh-config reload hub it does not exit and remains stuck in a loop with the following continuous output:

/opt/tljh/hub/lib/python3.6/site-packages/urllib3/connectionpool.py:988: InsecureRequestWarning: Unverified HTTPS request is being made to host '127.0.0.1' etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants