From e6c03e4b6e4ee2ccc3e3cd8b7a54c18f9685c2ba Mon Sep 17 00:00:00 2001 From: Luca <102960244+Luca-Timo@users.noreply.github.com> Date: Mon, 4 May 2026 20:07:13 +0200 Subject: [PATCH] fix(nginx): proxy /fonts requests to backend --- frontend/nginx.conf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index f3bf2e13..8080e090 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -122,6 +122,24 @@ server { proxy_cache_valid 404 1m; } + # Self-hosted webfonts proxy (bundled families + admin user additions). + # ^~ modifier stops regex matching, ensuring fonts are proxied to the + # backend (which scans backend/assets/fonts and STORAGE_PATH/fonts) and + # NOT served locally — the .woff2 files do not exist in the frontend image. + location ^~ /fonts { + set $backend_upstream backend; + proxy_pass http://$backend_upstream:3000; + proxy_http_version 1.1; + 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; + + # Fonts rarely change; cache aggressively (matches backend Cache-Control). + proxy_cache_valid 200 302 7d; + proxy_cache_valid 404 1m; + } + # Dynamic robots.txt served by backend location = /robots.txt { set $backend_upstream backend;