You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Frontend assets fail when Gogs is served from a reverse-proxy subpath #8385
Hi! I found this while testing the current main branch for a production deployment under /gogs.
Gogs does not load its production frontend correctly when the reverse proxy strips the configured subpath.
The HTML entrypoints use /gogs/assets/..., but the proxy forwards those requests to Gogs as /assets/.... The production static handler expects the /gogs prefix, so the request may fall through to the SPA handler and return HTML instead of JavaScript or CSS.
Some nested bundle assets also use root-relative /assets/... URLs. These bypass the /gogs/* proxy route and return a 404.
I linked draft PR for the proposed fix
To reproduce
Build Gogs from commit 2a0092707145 with the production frontend.
Inspect the browser network panel.
Requests below /gogs/assets/ may return HTML instead of the expected asset. Nested requests to /assets/ return 404 because they are outside the /gogs/* route.
Expected behavior
All frontend assets should load through /gogs/assets/ externally and resolve through /assets/ after the proxy strips the prefix.
JavaScript, CSS, fonts, and worker files should return successful responses with their expected content types.
Activity