Document reverse proxy header buffers for the sync websocket - #309
Open
LeoAnt02 wants to merge 1 commit into
Open
Document reverse proxy header buffers for the sync websocket#309LeoAnt02 wants to merge 1 commit into
LeoAnt02 wants to merge 1 commit into
Conversation
|
@LeoAnt02 is attempting to deploy a commit to the Rocicorp Team on Vercel. A member of the Team first needs to authorize it. |
LeoAnt02
force-pushed
the
docs/reverse-proxy-header-buffers
branch
from
August 4, 2026 03:59
537ffd2 to
82578c2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Zero client sends its entire client schema (plus auth token) URL-encoded in the
Sec-WebSocket-Protocolheader, andzero-cacheechoes it back in the101 Switching Protocolsresponse. Behind nginx or Kubernetes ingress-nginx with default settings,proxy_buffer_sizeis 4 KB — once an app's schema grows past that, the proxy rejects every sync connection with502 Bad Gatewaybefore anything reacheszero-cache.This is painful to diagnose in the wild:
zero-cachelogs — the 101 response dies at the proxy.I hit this in production: sync had worked for months, then adding a feature's tables pushed the encoded handshake from ~1.9 KB to ~4.7 KB and every environment behind nginx went dark simultaneously. Bisecting a padded
Sec-WebSocket-Protocolheader against the proxy showed the failure cliff exactly between 3.8 KB (101) and 4.2 KB (502), while the identical handshake succeeded againstzero-cachedirectly. Raisingproxy_buffer_sizefixed it instantly.Change
Adds a Reverse Proxies section to the deployment page documenting the mechanism, the symptom, and the fix (nginx and ingress-nginx examples), plus a note that request-side header limits can also be reached with large schemas + long JWTs.