fix(proxy): stop advertising HTTP/3 and enable Caddy access logs - #175
Merged
Conversation
Caddy enables HTTP/3 by default and adds `Alt-Svc: h3=":443"; ma=2592000` to every response, but the stack never made QUIC reachable: a compose port mapping written as "443:443" publishes TCP only, so UDP 443 was never forwarded to the container. The advertisement was therefore always false, regardless of how the host firewall is configured. Clients that act on it cache the alternative for up to 30 days and prefer HTTP/3 on subsequent navigations. With nothing listening, the QUIC handshake hangs until it times out and the browser shows a blank page. Reloading does not help, because the cached entry survives it; only clearing site data or disabling HTTP/3 in the browser restores access. The failure leaves no trace server-side, since no connection is ever established. Verified on a running deployment: responses carried the Alt-Svc header over HTTP/2 while a QUIC handshake to the same host timed out after 10s with no reply, and controls against public HTTP/3 endpoints completed in under 0.1s. Chromium forced onto QUIC for the origin failed with ERR_QUIC_PROTOCOL_ERROR; the same binary without the flag loaded the app normally. Disabling HTTP/3 rather than publishing 443/udp: browsers do not run the WebSocket API over HTTP/3, so the actor traffic that carries a live quiz stays on TCP either way and HTTP/3 would only affect the initial bundle load. The alternative would require the port publish and the operator's firewall to agree on every deployment, and this stack is shipped to self-hosters whose firewalls we do not control, leaving the advertisement in place would hand each of them the same latent outage. Also enables the site access log. Client IPs are filtered out: the diagnostic value is whether a request arrived at all, and that needs no personal data. Output goes to stderr, so `docker compose logs caddy` picks it up; the caddy service gains the same 20m/10-file json-file cap the backend and database already use.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Caddy enables HTTP/3 by default and adds
Alt-Svc: h3=":443"; ma=2592000to every response, but the stack never made QUIC reachable: a compose port mapping written as "443:443" publishes TCP only, so UDP 443 was never forwarded to the container. The advertisement was therefore always false, regardless of how the host firewall is configured.Clients that act on it cache the alternative for up to 30 days and prefer HTTP/3 on subsequent navigations. With nothing listening, the QUIC handshake hangs until it times out and the browser shows a blank page. Reloading does not help, because the cached entry survives it; only clearing site data or disabling HTTP/3 in the browser restores access. The failure leaves no trace server-side, since no connection is ever established.
Verified on a running deployment: responses carried the Alt-Svc header over HTTP/2 while a QUIC handshake to the same host timed out after 10s with no reply, and controls against public HTTP/3 endpoints completed in under 0.1s. Chromium forced onto QUIC for the origin failed with ERR_QUIC_PROTOCOL_ERROR; the same binary without the flag loaded the app normally.
Disabling HTTP/3 rather than publishing 443/udp: browsers do not run the WebSocket API over HTTP/3, so the actor traffic that carries a live quiz stays on TCP either way and HTTP/3 would only affect the initial bundle load. The alternative would require the port publish and the operator's firewall to agree on every deployment, and this stack is shipped to self-hosters whose firewalls we do not control, leaving the advertisement in place would hand each of them the same latent outage.
Also enables the site access log. Client
IPs are filtered out: the diagnostic value is whether a request arrived at all, and that needs no personal data. Output goes to stderr, so
docker compose logs caddypicks it up; the caddy service gains the same 20m/10-file json-file cap the backend and database already use.