static files aren't served in the right path when using SHIORI_HTTP_ROOT_PATH
Author: giujiCreated Sep 13, 2026Updated Sep 13, 2026
Labelstype:bug
Data
- Shiori version: 1.8.1-next (build 9a9a426acaca0e57e205bf20266a44954aaa8264)
- Operating system: linux
Describe the bug / actual behavior
when using --webroot /shiori/ or SHIORI_HTTP_ROOT_PATH=/shiori/, shiori keeps serving static files under /assets/ instead of /shiori/assets/, this results in a white blank screen when trying to connect to shiori as it fails to load stylesheets and js files
Expected behavior
when using --webroot /shiori/ or SHIORI_HTTP_ROOT_PATH=/shiori/, /shiori/assets/css/style.css should serve a stylesheet
To Reproduce
Steps to reproduce the behavior:
- run
shiori serve --address <host> --port <port> --webroot /shiori/or equivalentlySHIORI_HTTP_ROOT_PATH=/shiori/ shiori serve --address <host> --port <port> - open a browser and connect to
http://<host>:<port>/shiori/ - you should see a blank white screen
- open a browser and connect to
http://<host>:<port>/shiori/assets/css/style.css - you should see a blank white screen
- open a browser and connect to
http://<host>:<port>/assets/css/style.css - you should see a stylesheet
Screenshots
Notes
I don't know any go but it seems like GET /assets/ requests don't get routed properly when using --webroot, hardcoding the webroot in the static file routing/handling logic seems to fix it:
diff --git a/internal/http/handlers/frontend.go b/internal/http/handlers/frontend.go
index 280d3f5..2170274 100644
--- a/internal/http/handlers/frontend.go
+++ b/internal/http/handlers/frontend.go
@@ -50,5 +50,5 @@ func HandleAssets(deps model.Dependencies, c model.WebContext) {
if deps.Config().Http.ServeWebUIV2 {
fs = webapp.Assets
}
- http.StripPrefix("/assets/", http.FileServer(newAssetsFS(fs, deps.Config().Http.ServeWebUIV2))).ServeHTTP(c.ResponseWriter(), c.Request())
+ http.StripPrefix("/shiori/assets/", http.FileServer(newAssetsFS(fs, deps.Config().Http.ServeWebUIV2))).ServeHTTP(c.ResponseWriter(), c.Request())
}
diff --git a/internal/http/server.go b/internal/http/server.go
index 8f77f68..492b25d 100644
--- a/internal/http/server.go
+++ b/internal/http/server.go
@@ -97,7 +97,7 @@ func (s *HttpServer) Setup(cfg *config.Config, deps *dependencies.Dependencies)
handlers.HandleFrontend,
globalMiddleware...,
))
- s.mux.HandleFunc("GET /assets/", ToHTTPHandler(deps,
+ s.mux.HandleFunc("GET /shiori/assets/", ToHTTPHandler(deps,
handlers.HandleAssets,
globalMiddleware...,
))Source: go-shiori/shiori