Protocol version parsing in ngx_http_parse_status_line().
Once we know protocol version, set u->headers_in.connection_close to indicate
implicitly assumed connection close with HTTP before 1.1.
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index 902cfb8..0dfa16d 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -1210,6 +1210,7 @@
r->http_version = NGX_HTTP_VERSION_9;
u->state->status = NGX_HTTP_OK;
+ u->headers_in.connection_close = 1;
return NGX_OK;
}
@@ -1234,6 +1235,10 @@
"http proxy status %ui \"%V\"",
u->headers_in.status_n, &u->headers_in.status_line);
+ if (ctx->status.http_version < NGX_HTTP_VERSION_11) {
+ u->headers_in.connection_close = 1;
+ }
+
u->process_header = ngx_http_proxy_process_header;
return ngx_http_proxy_process_header(r);