From aa7eed0410deb18bdd3c9650960f6c7fa5ca834f Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Mon, 30 Nov 2026 19:41:41 +0000 Subject: [PATCH] dev2 gateway nginx: pass WebSocket upgrades for /desktop/v1/ws and /browse/v1/ws The catch-all location never set Upgrade/Connection, so nginx answered 400 ("Connection header did not include upgrade") for the c0mpute.com/desktop and /browse bridges while the worker on :7777 answered 101. Applied live on dev2 2026-11-30 (backup gateway.c0mpute.com.bak-20261130-ws); both now 101. Co-Authored-By: Claude Opus 5.5 --- .../nginx-gateway.c0mpute.com.conf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dev2/c0mpute-gateway/nginx-gateway.c0mpute.com.conf b/dev2/c0mpute-gateway/nginx-gateway.c0mpute.com.conf index 10a27d1..1315144 100644 --- a/dev2/c0mpute-gateway/nginx-gateway.c0mpute.com.conf +++ b/dev2/c0mpute-gateway/nginx-gateway.c0mpute.com.conf @@ -58,6 +58,24 @@ server { proxy_buffering off; proxy_request_buffering off; } + # WebSocket bridges to rented desktops (/desktop/v1/ws, noVNC) and remote + # browsers (/browse/v1/ws, CDP): the worker answers 101 only when the + # Upgrade header reaches it, and nginx drops hop-by-hop headers unless + # they are set here. Sessions are long-lived, so no 300 s idle cut. + location ~ ^/(desktop|browse)/v1/ws$ { + access_log off; + proxy_pass http://127.0.0.1:7777; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header 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 https; + proxy_read_timeout 3600s; + proxy_send_timeout 3600s; + proxy_buffering off; + } location / { # The c0mpute gateway writes its own access log (real client IPs) that # ThreatCrush tails; logging here too counted every request twice.