bito-code-review[bot] commented on PR #43169:
URL: https://github.com/apache/superset/pull/43169#issuecomment-5294997616
<!-- Bito Reply -->
The flagged issue is correct. The middleware change in `superset/app.py`
ensures that requests to `/static/...` are passed to the WSGI application, but
if the reverse proxy (e.g., nginx) does not forward these requests to the
application, they will still result in a 404 error before reaching the
middleware.
To resolve this, you must update your nginx configuration to ensure that
requests to `/static` are proxied to the Superset application, similar to how
the application root is proxied. For example, add a location block for
`/static` in your nginx configuration:
```nginx
location /static/ {
proxy_pass http://localhost:8088/static/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
```
This ensures that static assets are correctly routed to the application even
when an application root prefix is configured.
**superset/app.py**
```
if original_path_info == "/static" or
original_path_info.startswith("/static/"):
# Webpack bakes `/static/assets/` into the bundle as its
publicPath,
# so lazily loaded chunks and the assets they reference are
always
# requested without the app-root prefix. Serve those unprefixed
# paths as-is instead of 404ing them; the app root is left off
# PATH_INFO and SCRIPT_NAME because the static route is
registered
# at `/static/...` on the unprefixed app.
return self.wsgi_app(environ, start_response)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]