]> git.kaiwu.me - nginx.git/commitdiff
Remove Proxy-Connection HTTP upstream header
authorRoman Arutyunyan <arut@nginx.com>
Wed, 8 Apr 2026 12:51:07 +0000 (16:51 +0400)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Tue, 14 Apr 2026 05:53:13 +0000 (09:53 +0400)
As per RFC 9110, this header SHOULD be removed by a proxy.

Also, as per RFC 9113, this header MUST be removed when proxying to an
HTTP/2 backend.

src/http/modules/ngx_http_grpc_module.c
src/http/modules/ngx_http_proxy_module.c

index cc3aebe59496228ce289069cb60e29a39a085fdd..4a47b74c5a1724041256989b83975a4a4c54d826 100644 (file)
@@ -514,6 +514,7 @@ static ngx_keyval_t  ngx_http_grpc_headers[] = {
     { ngx_string("TE"), ngx_string("$grpc_internal_trailers") },
     { ngx_string("Host"), ngx_string("") },
     { ngx_string("Connection"), ngx_string("") },
+    { ngx_string("Proxy-Connection"), ngx_string("") },
     { ngx_string("Transfer-Encoding"), ngx_string("") },
     { ngx_string("Keep-Alive"), ngx_string("") },
     { ngx_string("Expect"), ngx_string("") },
index 0b388b30fab8fa274b3f35372f95f1e00528cd3f..e33dc37fdf0ba0cc0d463fb4edf639741e274a07 100644 (file)
@@ -747,6 +747,7 @@ static char  ngx_http_proxy_version_11[] = " HTTP/1.1" CRLF;
 static ngx_keyval_t  ngx_http_proxy_headers[] = {
     { ngx_string("Host"), ngx_string("$proxy_internal_host") },
     { ngx_string("Connection"), ngx_string("") },
+    { ngx_string("Proxy-Connection"), ngx_string("") },
     { ngx_string("Content-Length"), ngx_string("$proxy_internal_body_length") },
     { ngx_string("Transfer-Encoding"), ngx_string("$proxy_internal_chunked") },
     { ngx_string("TE"), ngx_string("") },
@@ -775,6 +776,7 @@ static ngx_str_t  ngx_http_proxy_hide_headers[] = {
 static ngx_keyval_t  ngx_http_proxy_cache_headers[] = {
     { ngx_string("Host"), ngx_string("$proxy_internal_host") },
     { ngx_string("Connection"), ngx_string("") },
+    { ngx_string("Proxy-Connection"), ngx_string("") },
     { ngx_string("Content-Length"), ngx_string("$proxy_internal_body_length") },
     { ngx_string("Transfer-Encoding"), ngx_string("$proxy_internal_chunked") },
     { ngx_string("TE"), ngx_string("") },