dragonflight/services
Zac Gaetano c24c6156dc fix(web-ui): stop nginx from eating Set-Cookie on /api/ and /capture/
Login was infinite-looping in production. Server side was healthy (sessions
landing in PG, /me returning 200 to a manually-signed cookie) but the
browser never received `Set-Cookie`. Bisected the proxy chain layer by
layer with direct curls on the box:

  - mam-api direct (port 47432) → Set-Cookie present
  - web-ui nginx (port 47434)   → Set-Cookie STRIPPED
  - NPM (https://dragonflight.live) → Set-Cookie stripped (because web-ui ate it)

Root cause was this in /api/ and /capture/:

    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

The literal "upgrade" was being sent on every request, not just real
WebSocket negotiations. Nginx then routes the upstream response through
its tunnel/upgrade code path, which doesn't preserve all response headers
the same way — Set-Cookie got silently dropped. mam-api doesn't speak
WebSockets today so it never sent a 101, and the bad pattern went
unnoticed until session-cookie auth shipped.

Fix is the standard conditional pattern: a `map` directive at the top of
default.conf computes $connection_upgrade as "upgrade" only when the
client actually requested Upgrade, otherwise "close". Both location blocks
now send `Connection $connection_upgrade` instead of the hardcoded literal.
WebSocket support on either location continues to work unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 22:00:35 -04:00
..
capture fix(recorders,library): empty-capture handling + right-click context menu 2026-05-23 03:52:30 +00:00
mam-api fix(auth): force HTTPS on dragonflight.live so login cookies stick 2026-05-27 22:00:35 -04:00
node-agent chore: 1.2 ship-prep sweep — close 38 issues 2026-05-27 02:06:14 +00:00
premiere-plugin feat(panel): add .connected-bar CSS for compact connected state 2026-05-27 19:31:16 -04:00
web-ui fix(web-ui): stop nginx from eating Set-Cookie on /api/ and /capture/ 2026-05-27 22:00:35 -04:00
worker feat(audio-tab): full audio track inspector with meters, mute/solo, faders 2026-05-27 04:53:52 +00:00