The official NGINX Open Source repository.
Go to file
Justin Li 573ec98d24 Upstream: avoid closing client connection in edge case.
If proxy_cache is enabled, and proxy_no_cache tests true, it was previously
possible for the client connection to be closed after a 304. The fix is to
recheck r->header_only after the final cacheability is determined, and end the
request if no longer cacheable.

Example configuration:

proxy_cache foo;
proxy_cache_bypass 1;
proxy_no_cache 1;

If a client sends If-None-Match, and the upstream server returns 200 with a
matching ETag, no body should be returned to the client. At the start of
ngx_http_upstream_send_response proxy_no_cache is not yet tested, thus cacheable
is still 1 and downstream_error is set.

However, by the time the downstream_error check is done in process_request,
proxy_no_cache has been tested and cacheable is set to 0. The client connection
is then closed, regardless of keepalive.
2016-03-08 22:31:55 -05:00
auto Configure: style. 2016-03-10 18:31:05 +03:00
conf Added the REQUEST_SCHEME parameter. 2015-06-05 22:23:26 +03:00
contrib Contrib: add more directives to vim syntax. 2014-10-22 15:31:19 +02:00
docs nginx-1.9.12-RELEASE 2016-02-24 17:53:22 +03:00
misc Updated OpenSSL used for win32 builds. 2016-02-13 07:28:14 +03:00
src Upstream: avoid closing client connection in edge case. 2016-03-08 22:31:55 -05:00
.hgtags release-1.9.12 tag 2016-02-24 17:53:23 +03:00