HTTP/3: initialize Host header from :authority to enable $http_host variable#1
Open
MarcoMarcoaldi wants to merge 1 commit intomasterfrom
Open
HTTP/3: initialize Host header from :authority to enable $http_host variable#1MarcoMarcoaldi wants to merge 1 commit intomasterfrom
MarcoMarcoaldi wants to merge 1 commit intomasterfrom
Conversation
…ariable This patch ensures that NGINX correctly initializes the HTTP Host header from the :authority pseudo-header when handling HTTP/3 (QUIC) requests. Currently, the $http_host variable is not set under HTTP/3, breaking compatibility with configurations relying on it. According to RFC 9114 Section 4.2, :authority and Host must have the same value if both are present. This patch sets Host from :authority when missing, ensuring consistent behavior across HTTP/1.1, HTTP/2, and HTTP/3. Successfully tested in production.
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.
Description
Currently, when handling HTTP/3 (QUIC) requests, NGINX does not properly set
the
$http_hostvariable. This is inconsistent with HTTP/1.1 and HTTP/2handling and breaks compatibility with configurations relying on
$http_host.According to RFC 9114 Section 4.2:
This patch initializes the
Hostheader from the:authoritypseudo-headerwhen it is missing, ensuring consistent behavior across all HTTP versions.
✅ Testing
The patch has been successfully tested in production on NGINX 1.29.1,
built with the
--with-http_v3_moduleflag.After applying the patch,
$http_hostis correctly set from:authorityfor HTTP/3 requests.
🧩 Notes
This is a backward-compatible change aligned with RFC 9114 and mirrors HTTP/2’s
handling of the
:authorityfield.Note: Patch also sent to the official nginx-devel mailing list.
Full diff for reference: