]> git.kaiwu.me - nginx.git/commit
Upstream: special handling of the "Host" header in proxy and gRPC
authorRoman Arutyunyan <arut@nginx.com>
Tue, 21 Jul 2026 14:14:39 +0000 (18:14 +0400)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Fri, 7 Aug 2026 14:54:23 +0000 (18:54 +0400)
commitdea68dbf126f40a8acd09bac885a955be459162e
treedb6236657cb5fc0cedb70605e61a70cdf6d7cb3a
parente419e28c98378ecf4e373f0c660e6c03665efd62
Upstream: special handling of the "Host" header in proxy and gRPC

HTTP/2 and gRPC requests are now always sent with the ":authority"
pseudo-header, while the "Host" header is no longer passed.
Where a host value is set explicitly with "proxy_set_header Host"
or "grpc_set_header Host", that value is conveyed in ":authority".
As per RFC 9113, Section 8.3.1, clients and intermediaries MUST
generate an ":authority" pseudo-header to convey authority information.

For HTTP/1.1, HTTP/2 and gRPC, if the explicit value is empty, then
the value of $proxy_host is used instead.  As per RFC 9110, Sections
4.2.1 and 4.2.2, the "http" and "https" URI schemes MUST contain a
non-empty host identifier.  The change enforces this rule by
introducing a default.

Closes: https://github.com/nginx/nginx/issues/1426
src/http/modules/ngx_http_grpc_module.c
src/http/modules/ngx_http_proxy_module.c
src/http/modules/ngx_http_proxy_module.h
src/http/modules/ngx_http_proxy_v2_module.c