GitHub user dosubot[bot] added a comment to the discussion: Login redirection does not use subpath prefix
<!-- Answer --> The `/analytics/analytics` double-prefixing and broken images are caused by a **conflict between two prefix mechanisms** that are both active in your setup. **What's happening:** You have `SUPERSET_APP_ROOT="/analytics"` (which activates `AppRootMiddleware`) AND you're sending the `X-Forwarded-Prefix=/analytics` header. When `ENABLE_PROXY_FIX=True` with default `x_prefix=1`, both middlewares independently apply the prefix to `SCRIPT_NAME`, resulting in `/analytics/analytics` [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/app.py#L83-L107) [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/initialization/__init__.py#L643-L646). **The fix — remove the `X-Forwarded-Prefix` header and disable `x_prefix`:** **Traefik labels** (remove the custom header middleware): ```yaml labels: - "traefik.enable=true" - "traefik.http.routers.superset.rule=Host(`localhost`) && PathPrefix(`/analytics`)" - "traefik.http.routers.superset.entrypoints=websecure" - "traefik.http.routers.superset.tls=true" - "traefik.http.services.superset.loadbalancer.server.port=8088" # NO X-Forwarded-Prefix middleware # NO StripPrefix middleware ``` **superset_config.py:** ```python ENABLE_PROXY_FIX = True PROXY_FIX_CONFIG = { "x_for": 1, "x_proto": 1, "x_host": 1, "x_port": 1, "x_prefix": 0 # <-- critical: disable prefix processing } ``` **Why this works:** When using `SUPERSET_APP_ROOT`, Traefik should forward the full path (e.g., `/analytics/superset/welcome/`) **without stripping it**. The `AppRootMiddleware` will strip `/analytics` from the path internally and set `SCRIPT_NAME=/analytics` so Flask generates all URLs correctly — no `X-Forwarded-Prefix` needed [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/app.py#L83-L107). Regarding the broken logo image specifically — there was a fix in [PR #39472](https://github.com/apache/superset/pull/39472) that resolved double-prefixing of logo/static asset URLs [[3]](https://github.com/apache/superset/pull/39472). Since you're on the 6.1.0 branch, that fix should be included, and the image issue should resolve once you eliminate the double-prefixing from your proxy config. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=fc0df020-2087-468e-89a0-be6d7f936b9a) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset) GitHub link: https://github.com/apache/superset/discussions/40082#discussioncomment-16965166 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
