Bug description
When deploying Superset under a subpath using SUPERSET_APP_ROOT (e.g. /dashboards), all requests to /static/ assets return 404. This affects static assets such as the logo, CSS, and JS bundles — webpack compiles asset paths with a hardcoded /static/assets/ publicPath that does not include the app root prefix.
Root cause
AppRootMiddleware.__call__ returns NotFound() for any request that does not start with self.app_root. Since webpack always generates /static/assets/... paths (without the app root prefix), these requests are blocked:
# Current behavior — blocks /static/ requests
if original_path_info.startswith(self.app_root):
...
else:
return NotFound()(environ, start_response) # ← blocks /static/assets/*
Steps to reproduce
- Set
SUPERSET_APP_ROOT=/dashboards (or any non-root value)
- Configure a reverse proxy (nginx/Apache) with:
ProxyPass /dashboards http://localhost:8088/dashboards
ProxyPass /static http://localhost:8088/static
- Open
https://<host>/dashboards in a browser
- Observe 404 for
https://<host>/static/assets/images/superset-logo-horiz.png
Expected behavior
Static assets under /static/ should be served regardless of the configured app root, since webpack hardcodes /static/assets/ as the publicPath at build time.
Proposed fix
Add an elif branch to AppRootMiddleware.__call__ to pass /static/ requests through without stripping the app root:
elif original_path_info.startswith("/static/"):
# Webpack compiles asset paths with hardcoded /static/assets/ publicPath.
# Pass these through without stripping the app root so static assets
# are served correctly in subdirectory deployments.
return self.wsgi_app(environ, start_response)
Superset version
6.1.0rc1
Python version
3.11
Browser
Chrome
Additional context
Checklist
Bug description
When deploying Superset under a subpath using
SUPERSET_APP_ROOT(e.g./dashboards), all requests to/static/assets return 404. This affects static assets such as the logo, CSS, and JS bundles — webpack compiles asset paths with a hardcoded/static/assets/publicPath that does not include the app root prefix.Root cause
AppRootMiddleware.__call__returnsNotFound()for any request that does not start withself.app_root. Since webpack always generates/static/assets/...paths (without the app root prefix), these requests are blocked:Steps to reproduce
SUPERSET_APP_ROOT=/dashboards(or any non-root value)ProxyPass /dashboards http://localhost:8088/dashboardsProxyPass /static http://localhost:8088/statichttps://<host>/dashboardsin a browserhttps://<host>/static/assets/images/superset-logo-horiz.pngExpected behavior
Static assets under
/static/should be served regardless of the configured app root, since webpack hardcodes/static/assets/as the publicPath at build time.Proposed fix
Add an
elifbranch toAppRootMiddleware.__call__to pass/static/requests through without stripping the app root:Superset version
6.1.0rc1
Python version
3.11
Browser
Chrome
Additional context
AppRootMiddlewareblocking of/static/requests.publicPathis hardcoded to/static/assets/inwebpack.config.jsand cannot be changed at runtime.service-worker.jsis missing from the production Docker image entirely (separate Dockerfile bug).Checklist