From 304441d95a369ea3b4f1a6f364340c273e51c9a7 Mon Sep 17 00:00:00 2001 From: Gitead Date: Mon, 17 Aug 2026 23:41:10 -0400 Subject: [PATCH] fix: nginx proxy_pass uses 127.0.0.1 instead of localhost localhost resolves to ::1 first; backend/Vite only bind IPv4, causing intermittent 502s when nginx tried the IPv6 loopback address. Co-Authored-By: Claude Sonnet 5 --- nginx.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nginx.conf b/nginx.conf index 108da622..0c46c8d0 100644 --- a/nginx.conf +++ b/nginx.conf @@ -17,7 +17,7 @@ server { # API requests → backend (Authorization header must be explicit or it gets stripped) location /api/ { - proxy_pass http://localhost:5000; + proxy_pass http://127.0.0.1:5000; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -27,7 +27,7 @@ server { # Socket.IO → backend (WebSocket upgrade) location /socket.io/ { - proxy_pass http://localhost:5000; + proxy_pass http://127.0.0.1:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; @@ -37,7 +37,7 @@ server { # Everything else → Vite dev server location / { - proxy_pass http://localhost:3000; + proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; @@ -57,7 +57,7 @@ server { client_max_body_size 50m; location /api/twilio/ { - proxy_pass http://localhost:5000; + proxy_pass http://127.0.0.1:5000; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr;