Fix nginx: rewrite font paths in CSS to prevent double fonts/ directory (STI-91)
Some checks failed
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy (push) Has been cancelled
Code Quality / quality (push) Has been cancelled

GrampsWeb's fonts.css references fonts as url('fonts/MaterialIcons.woff2').
Since fonts.css is served from /ahnenforschung/fonts/fonts.css, the browser
resolves this to /ahnenforschung/fonts/fonts/MaterialIcons.woff2 (double
fonts/ directory). Strip the fonts/ prefix via sub_filter so the URL
resolves correctly to /ahnenforschung/fonts/MaterialIcons.woff2.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
SysAdmin Agent
2026-04-05 11:25:47 +00:00
parent 1429357924
commit ebaaf3dad3

View File

@@ -126,7 +126,11 @@ server {
# JS: service worker route handling
sub_filter 'createHandlerBoundToURL("/index.html")' 'createHandlerBoundToURL("/ahnenforschung/index.html")';
# CSS: font paths — ../fonts/ resolves correctly from subpath, no rewrite needed
# CSS: fix font paths in fonts.css — the CSS lives at /ahnenforschung/fonts/fonts.css
# and references url('fonts/MaterialIcons.woff2') which resolves to
# /ahnenforschung/fonts/fonts/MaterialIcons.woff2 (double fonts/).
# Strip the fonts/ prefix so url('MaterialIcons.woff2') resolves correctly.
sub_filter "url('fonts/" "url('";
# WebSocket support
proxy_http_version 1.1;