docs: document reverse proxy configuration for the SSE push transport - #6059
Open
mcollovati wants to merge 1 commit into
Open
mcollovati wants to merge 1 commit into
mcollovati wants to merge 1 commit into
Conversation
Contributor
Preview DeploymentThis PR has been deployed for preview. URL: https://docs-preview-pr-6059.fly.dev Changed pagesAdded content is highlighted in green; removed content is marked in red on each page.
Built from e27451e |
Server-Sent Events is a plain HTTP GET that never ends, so none of the WebSocket upgrade configuration applies to it. What it needs instead is that the proxy does not buffer or close the response stream. Add a Server-Sent Events section covering those requirements, the browser connection limit, the WebSocket-only Hilla reactive endpoints, TLS termination, and how to verify a deployment. Add the required directives to the configuration examples, marked with "Server-sent events only" comments: - proxy_http_version, proxy_buffering and proxy_read_timeout on the nginx push locations. The push location is no longer marked as WebSockets only, since both transports need it. - flushpackets=on on the AJP workers, which lets push travel over AJP and removes the need for a second channel to the HTTP port of the backend. Also switch the path specific Apache HTTPD rules from ws:// to upgrade=websocket, so that a single rule serves both transports, and declare them before the catch-all. Without that ordering, mod_proxy shares the catch-all worker and silently discards the upgrade option. Add a Compression and Push section. Compressing a streamed response does not stall it, since both mod_deflate and the nginx gzip filter flush after each event, but it is still worth avoiding: a compression context stays allocated for the life of every push connection, and the 2000 bytes of Atmosphere padding shrink to a few dozen bytes, defeating their purpose of forcing an intermediary to flush. PUSH answers with text/event-stream over Server-Sent Events and with text/plain over streaming and long polling, so keeping both out of gzip_types and AddOutputFilterByType is what matters, and it holds wherever the push endpoint is mapped. Rename the WebSocket Connection Timeout section to Push Connection Timeout, as the heartbeat applies to every transport, and raise the timeout from 90 to 300 seconds. The default of 60 seconds coincides exactly with the heartbeat interval, leaving no margin.
mcollovati
force-pushed
the
chore/update-reverse-proxy-docs
branch
from
September 16, 2026 19:03
d16e482 to
604f7d0
Compare
Contributor
Author
|
The documented configurations have been tested here, and smoke tests for over 60 different configurations are passing (https://github.com/mcollovati/vaadin-reverse-proxy-tests/actions/runs/35142512190) |
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.
Server-Sent Events is a plain HTTP GET that never ends, so none of the WebSocket upgrade configuration applies to it. What it needs instead is that the proxy does not buffer or close the response stream.
Add a Server-Sent Events section covering those requirements, the browser connection limit, the WebSocket-only Hilla reactive endpoints, TLS termination, and how to verify a deployment. Add the required directives to the configuration examples, marked with "Server-sent events only" comments:
Also switch the path specific Apache HTTPD rules from ws:// to upgrade=websocket, so that a single rule serves both transports, and declare them before the catch-all. Without that ordering, mod_proxy shares the catch-all worker and silently discards the upgrade option.
Add a Compression and Push section. Compressing a streamed response does not stall it, since both mod_deflate and the nginx gzip filter flush after each event, but it is still worth avoiding: a compression context stays allocated for the life of every push connection, and the 2000 bytes of Atmosphere padding shrink to a few dozen bytes, defeating their purpose of forcing an intermediary to flush. PUSH answers with text/event-stream over Server-Sent Events and with text/plain over streaming and long polling, so keeping both out of gzip_types and AddOutputFilterByType is what matters, and it holds wherever the push endpoint is mapped.
Rename the WebSocket Connection Timeout section to Push Connection Timeout, as the heartbeat applies to every transport, and raise the timeout from 90 to 300 seconds. The default of 60 seconds coincides exactly with the heartbeat interval, leaving no margin.