Skip to content

Use the proxied url as the Jupyter server url - #3936

Open
Sanjays2402 wants to merge 1 commit into
plotly:devfrom
Sanjays2402:fix/jupyter-dash-proxy
Open

Use the proxied url as the Jupyter server url#3936
Sanjays2402 wants to merge 1 commit into
plotly:devfrom
Sanjays2402:fix/jupyter-dash-proxy

Conversation

@Sanjays2402

Copy link
Copy Markdown

Fixes #3401.

When DASH_PROXY (or run(proxy=...)) is set, the app is served on host:port but reached through the proxy. run() already used the proxied url for the "Dash is running on" log line, but passed nothing to jupyter_dash.run_app(), so JupyterDash fell back to http://host:port for both the external url and the inline iframe — unreachable behind the proxy. server_url is now derived from the proxied half of the proxy string when the caller did not pass jupyter_server_url explicitly.

Contributor Checklist

  • I have broken down my PR scope into the following TODO tasks
    • pass the proxied url through to jupyter_dash.run_app()
    • add a regression test
  • I have run the tests locally and they passed. (refer to testing section in contributing)
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR

tests/unit/test_configs.py passes (the 2 unrelated failures in that file are missing built JS assets in my source checkout, identical before and after this change). The new test_proxy_jupyter_server_url fails without the fix (server_url is None) and passes with it.

optionals

  • I have added entry in the CHANGELOG.md
  • If this PR needs a follow-up in dash docs, community thread, I have mentioned the relevant URLS as follows
    • this GitHub #PR number updates the dash docs
    • here is the show and tell thread in Plotly Dash community

This change was prepared with AI assistance; the regression test was run locally and fails without the fix.

When DASH_PROXY (or run(proxy=...)) is set, the app is served on
host:port but reached through the proxy. run() already used the proxied
url for the 'Dash is running on' message, but passed nothing to
jupyter_dash.run_app(), so JupyterDash fell back to http://host:port for
the external url and the inline iframe, which is unreachable behind a
proxy.

Derive server_url from the proxied half of the proxy string when the
caller did not pass jupyter_server_url explicitly.

Fixes plotly#3401
@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] DASH_PROXY not used by JupyterDash

1 participant