fix(proxy): forward WebSocket upgrades and disable buffering in proxy configs
The nginx config written by install.sh proxied waiter.*, manager.* and the IP default_server without proxy_http_version 1.1 or Upgrade/Connection headers, so /api/ws/connect never upgraded and live events (new orders, KDS status, chat, phone calls) never reached waiters or the manager. The repo's nginx-proxy/nginx.conf had the same gap on the manager block. Both configs now use a $connection_upgrade map, 1h read/send timeouts and proxy_buffering off (SSE) on every proxied location. Verified with nginx -t and a header-echo upstream: old config strips Upgrade, new one forwards it. Existing sites: copy the new install.sh, re-run it, restart the proxy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+18
-2
@@ -1,3 +1,11 @@
|
||||
# Repo/dev proxy config. install.sh writes its own copy on client sites — keep both in sync.
|
||||
# Every proxied location must forward WebSocket upgrades (/api/ws/connect) and
|
||||
# must not buffer (SSE), otherwise live events never reach waiters / KDS.
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
return 301 https://$host$request_uri;
|
||||
@@ -16,12 +24,14 @@ server {
|
||||
proxy_pass http://waiter_pwa:80;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $http_connection;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 3600;
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
proxy_buffering off;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +46,15 @@ server {
|
||||
|
||||
location / {
|
||||
proxy_pass http://manager_dashboard:80;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
proxy_buffering off;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user