Skip to content

Instantly share code, notes, and snippets.

@kazeburo
Created March 18, 2019 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazeburo/0cccb6b5c9bab5cb140805c2fa9de480 to your computer and use it in GitHub Desktop.
Save kazeburo/0cccb6b5c9bab5cb140805c2fa9de480 to your computer and use it in GitHub Desktop.
diff --git a/src/ngx_http_headers_more_headers_in.c b/src/ngx_http_headers_more_headers_in.c
index c3eb8f7..527c8a5 100644
--- a/src/ngx_http_headers_more_headers_in.c
+++ b/src/ngx_http_headers_more_headers_in.c
@@ -739,6 +739,7 @@ ngx_http_set_connection_header(ngx_http_request_t *r,
if (ngx_strcasestrn(value->data, "close", 5 - 1)) {
r->headers_in.connection_type = NGX_HTTP_CONNECTION_CLOSE;
r->headers_in.keep_alive_n = -1;
+ r->keepalive = 0;
} else if (ngx_strcasestrn(value->data, "keep-alive", 10 - 1)) {
r->headers_in.connection_type = NGX_HTTP_CONNECTION_KEEP_ALIVE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment