Fix nginx: rewrite font paths in CSS to prevent double fonts/ directory (STI-91)
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user