From 40d9fb330fbd18e6e01aacdf2991f39be912a78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 9 Nov 2025 15:11:29 +0100 Subject: [PATCH] fix: use exact match for /api/fonts location in nginx - Changed from prefix match to exact match (location =) - Ensures /api/fonts takes priority over other location blocks - Removes unnecessary regex location block for API routes --- nginx.conf | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/nginx.conf b/nginx.conf index 72b3f2f..9969915 100644 --- a/nginx.conf +++ b/nginx.conf @@ -38,18 +38,13 @@ http { add_header Referrer-Policy "no-referrer-when-downgrade" always; # API routes - serve as JSON (Next.js static export creates files without extensions) - location /api/fonts { + # Use exact match to ensure this takes precedence + location = /api/fonts { default_type application/json; add_header Cache-Control "public, max-age=3600"; try_files /api/fonts =404; } - location ~ ^/api/ { - default_type application/json; - add_header Cache-Control "public, max-age=3600"; - try_files $uri =404; - } - # Cache static assets location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|flf)$ { expires 1y;