From 905655a8a587cceaba4f2e8f2a24f7dff7d471dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 23 Jul 2026 21:02:35 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20proxy=20the=20whole=20/ap?= =?UTF-8?q?i=20namespace,=20not=20an=20allowlist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The enumerated proxy allowlist silently dropped homework, messages, and questions: those requests fell through to the SPA fallback, returned index.html, and broke the client's JSON parse in the container build. Proxy all of /api/ so a new backend or frontend resource can never be forgotten again. --- nginx.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 453c7f4..13864e5 100644 --- a/nginx.conf +++ b/nginx.conf @@ -3,7 +3,12 @@ server { root /usr/share/nginx/html; index index.html; - location ~ ^/api/(auth|users|notes|events|exams|courses|sessions|marks|attendance|work|pomodoro|settings|subjects|terms|health|time)(/|$) { + # Proxy the whole /api/* namespace, not a hand-maintained allowlist: an + # enumerated list silently 404s (falls through to the SPA -> HTML -> the + # client's JSON.parse fails) every time the backend or frontend gains a + # resource the list forgot. homework, messages, and questions were all + # already broken this way. + location /api/ { rewrite ^/api(/.*)$ $1 break; proxy_pass http://hezarfen-backend:8080; proxy_http_version 1.1;