The official NGINX Open Source repository.
Go to file
Maxim Dounin 3377c00119 Upstream: fixed "header already sent" alerts on backend errors.
Following ad3f342f14ba046c (1.9.13), it is possible that a request where
header was already sent will be finalized with NGX_HTTP_BAD_GATEWAY,
triggering an attempt to return additional error response and the
"header already sent" alert as a result.

In particular, it is trivial to reproduce the problem with a HEAD request
and caching enabled.  With caching enabled nginx will change HEAD to GET
and will set u->pipe->downstream_error to suppress sending the response
body to the client.  When a backend-related error occurs (for example,
proxy_read_timeout expires), ngx_http_finalize_upstream_request() will
be called with NGX_HTTP_BAD_GATEWAY.  After ad3f342f14ba046c this will
result in ngx_http_finalize_request(NGX_HTTP_BAD_GATEWAY).

Fix is to move u->pipe->downstream_error handling to a later point,
where all special response codes are changed to NGX_ERROR.

Reported by Jan Prachar,
http://mailman.nginx.org/pipermail/nginx-devel/2018-January/010737.html.
2018-01-11 21:43:49 +03:00
auto Fixed capabilities version. 2017-12-19 19:00:27 +03:00
conf MIME: added most common OpenDocument types. 2017-10-02 19:07:01 +03:00
contrib Contrib: vim syntax, update core module directives. 2017-12-28 12:01:05 +02:00
docs Year 2018. 2018-01-11 21:43:24 +03:00
misc Updated OpenSSL used for win32 builds. 2017-12-26 17:48:49 +03:00
src Upstream: fixed "header already sent" alerts on backend errors. 2018-01-11 21:43:49 +03:00
.hgtags release-1.13.8 tag 2017-12-26 19:01:12 +03:00