From b2d6da24aa853508c3bef17da0c8806f61165a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 9 Nov 2025 14:37:04 +0100 Subject: [PATCH] fix: ensure API routes are served with correct Content-Type in nginx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add specific location block for /api/ routes with application/json Content-Type - Add .flf extension to cached static assets for font files - This fixes fonts not loading in production static export 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- nginx.conf | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 4ccccd4..f215ae8 100644 --- a/nginx.conf +++ b/nginx.conf @@ -37,8 +37,15 @@ http { add_header X-XSS-Protection "1; mode=block" always; add_header Referrer-Policy "no-referrer-when-downgrade" always; + # API routes - serve as JSON + location ~ ^/api/ { + add_header Content-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)$ { + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|flf)$ { expires 1y; add_header Cache-Control "public, immutable"; }