From 13db39227355085a1940a9dcd43e92eb3e79fde0 Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Tue, 5 May 2026 17:40:31 +0300 Subject: [PATCH] fix(nginx): exclude /api/ paths from static asset location block The static asset regex matched .png in /api/v1/og/contributions.png before the /api/ proxy block, returning 404. Add negative lookahead to skip /api/ paths. Co-Authored-By: Claude Opus 4.6 (1M context) --- asset/nginx/site.conf.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asset/nginx/site.conf.tmpl b/asset/nginx/site.conf.tmpl index 7f9d12c..24e59ad 100644 --- a/asset/nginx/site.conf.tmpl +++ b/asset/nginx/site.conf.tmpl @@ -20,7 +20,7 @@ server { add_header Cache-Control "no-cache" always; } - location ~* \.(js|css|woff2?|ttf|eot|svg|png|jpg|jpeg|gif|ico|webp|avif)$ { + location ~* ^(?!/api/)\S+\.(js|css|woff2?|ttf|eot|svg|png|jpg|jpeg|gif|ico|webp|avif)$ { expires 30d; add_header Cache-Control "public, max-age=2592000, immutable"; try_files $uri =404;