Skip to content

Instantly share code, notes, and snippets.

@kazeburo
Created February 9, 2012 08:20
Show Gist options
  • Save kazeburo/1778392 to your computer and use it in GitHub Desktop.
Save kazeburo/1778392 to your computer and use it in GitHub Desktop.
nginx HTTP/1.0 upstream keepalive
--- nginx-1.1.14.orig/src/http/ngx_http_upstream.c 2012-01-19 00:07:43.000000000 +0900
+++ nginx-1.1.14/src/http/ngx_http_upstream.c 2012-02-09 17:11:02.000000000 +0900
@@ -3426,6 +3426,13 @@
r->upstream->headers_in.connection_close = 1;
}
+ if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len,
+ (u_char *) "keep-alive", 10 - 1)
+ != NULL)
+ {
+ r->upstream->headers_in.connection_close = 0;
+ }
+
return NGX_OK;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment