fix(nginx): proxy /fonts requests to backend

This commit is contained in:
Luca
2026-05-04 20:07:13 +02:00
parent b4f9b65f1d
commit e6c03e4b6e
+18
View File
@@ -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;