From 6cf5bf76b36723cb7e82d51ea0837b8f587a0961 Mon Sep 17 00:00:00 2001 From: josh Date: Mon, 27 Apr 2026 19:59:32 -0400 Subject: [PATCH] Add nginx reverse proxy for /api and /health to backend server The frontend builds with VITE_API_URL=/api so all API calls target the same origin. Without a proxy rule, nginx was serving index.html for API paths, causing JSON parse errors. Co-Authored-By: Claude Opus 4.6 --- apps/web/nginx.conf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/web/nginx.conf b/apps/web/nginx.conf index e864e54..f49693a 100644 --- a/apps/web/nginx.conf +++ b/apps/web/nginx.conf @@ -3,6 +3,17 @@ server { root /usr/share/nginx/html; index index.html; + location /api/ { + proxy_pass http://server:3001; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location /health { + proxy_pass http://server:3001; + } + location / { try_files $uri $uri/ /index.html; }