# HG changeset patch # User Maxim Dounin # Date 1633532502 -10800 # Node ID ae7c767aa491fa55d3168dfc028a22f43ac8cf89 # Parent bfad703459b4e2416548ac66f548e96c2197d9cc Fixed $content_length cacheability with chunked (ticket #2252). diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c --- a/src/http/ngx_http_variables.c +++ b/src/http/ngx_http_variables.c @@ -1179,6 +1179,10 @@ ngx_http_variable_content_length(ngx_htt v->no_cacheable = 0; v->not_found = 0; + } else if (r->headers_in.chunked) { + v->not_found = 1; + v->no_cacheable = 1; + } else { v->not_found = 1; }