Trying to expose jupyterlab with tunnel

I am trying to expose jupyterlab with tunnel, it is ok to visit the auth page.

input correct token and login. get a blank page. looks like something wrong with proxy and can see 302 error as below.

[I 2024-03-01 07:41:50.563 ServerApp] Jupyter Server 2.12.5 is running at:

[I 2024-03-01 07:41:50.563 ServerApp] http://627ae05775d7:8888/lab?token=

[I 2024-03-01 07:41:50.563 ServerApp] http://127.0.0.1:8888/lab?token=

[I 2024-03-01 07:41:50.563 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

[I 2024-03-01 07:41:51.459 ServerApp] 302 GET / (@192.168.48.1) 0.75ms

[I 2024-03-01 07:41:51.610 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server

[I 2024-03-01 07:41:51.674 LabApp] 302 GET /lab? (@192.168.48.1) 1.42ms

[I 2024-03-01 07:41:59.512 ServerApp] 302 GET / (@192.168.48.1) 0.59ms

[W 2024-03-01 07:41:59.934 ServerApp] Clearing invalid/expired login cookie username-jupyter-xxx-com

[I 2024-03-01 07:41:59.935 LabApp] 302 GET /lab? (@192.168.48.1) 1.13ms

[I 2024-03-01 07:42:14.411 ServerApp] User xxxa0ad913d73c6e759 logged in.

[I 2024-03-01 07:42:14.412 ServerApp] 302 POST /login?next=%2Flab%3F ([email protected]) 1.36ms

I encounter same issue and manage to solve it.
TLDR: toggle OFF Rocket Loader in your cloudflare domain dashboard.
You can of couse set custom rule for your jupyter url.

OS: Ubuntu 24.04.1 (x86)
Jupyterlab version: 4.2.5, installed via micromamba
cloudflared version: 2024.8.3
Jupyterlab config.py:

from jupyter_server.auth.identity import PasswordIdentityProvider

c = get_config()  # noqa
c.ServerApp.ip = "0.0.0.0"
c.ServerApp.port = 8888
c.ServerApp.allow_remote_access = True
c.ServerApp.allow_origin = "*"
c.ServerApp.root_dir = "/home/USER/notebooks"
c.ServerApp.open_browser = False
# not for production
# c.ServerApp.token = ""
# c.ServerApp.password = ""

PasswordIdentityProvider.hashed_password = "HASHED_PSWD"

And start jupyterlab with: $jupyter lab --config ~/notebooks/config.py

1 Like

awesome, dude, thanks a lot.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.