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 <noreply@anthropic.com>
This commit is contained in:
+4
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user