From a9201138c208433ba5068f421f7afc3630a05522 Mon Sep 17 00:00:00 2001 From: SysAdmin Agent Date: Sun, 5 Apr 2026 11:36:59 +0000 Subject: [PATCH] Fix nginx: add location block for double fonts/ path in GrampsWeb (STI-91) GrampsWeb's fonts.css references url('fonts/file.woff2') but is served from /ahnenforschung/fonts/fonts.css, causing the browser to request /ahnenforschung/fonts/fonts/file.woff2 (double fonts/ directory). Instead of relying on sub_filter to rewrite CSS content, add a dedicated location block that proxies /ahnenforschung/fonts/fonts/ to the correct /fonts/ path on the GrampsWeb container. This is more robust as it works regardless of CSS content-type matching. Co-Authored-By: Paperclip --- deploy-production/nginx.conf | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/deploy-production/nginx.conf b/deploy-production/nginx.conf index 3ef22bf..ccaf93f 100644 --- a/deploy-production/nginx.conf +++ b/deploy-production/nginx.conf @@ -82,6 +82,17 @@ server { proxy_send_timeout 300s; } + # GrampsWeb: fix double fonts/ path from CSS relative URL resolution + # fonts.css at /ahnenforschung/fonts/ references url('fonts/file.woff2') + # which resolves to /ahnenforschung/fonts/fonts/file.woff2 + location /ahnenforschung/fonts/fonts/ { + proxy_pass http://127.0.0.1:8090/fonts/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + # GrampsWeb Ahnenforschung # All path rewriting happens here via sub_filter — no container-side patching needed. # GrampsWeb SPA uses Vaadin Router with absolute paths; the injected History API @@ -126,11 +137,7 @@ server { # JS: service worker route handling sub_filter 'createHandlerBoundToURL("/index.html")' 'createHandlerBoundToURL("/ahnenforschung/index.html")'; - # 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('"; + # CSS font paths: handled by separate location block for /ahnenforschung/fonts/fonts/ # WebSocket support proxy_http_version 1.1;