Upstream: switch off proxy_store if upstream said to

HG changeset patch

User Maxim D. [email protected]

Date 1225109078 -10800

Node ID 95401a3e26032e24cb78712a1d64893806472156

Parent 9a6bf5cfcd63433a28dc00064af195a91b628d64

Upstream: switch off proxy_store if upstream said to.

If we got X-Accel-Expires header with value 0 from upstream, don’t store
response.

diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
— a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2126,6 +2126,9 @@ ngx_http_upstream_process_body(ngx_event

         if (p->upstream_eof
             && u->headers_in.status_n == NGX_HTTP_OK
  •            && (!u->headers_in.x_accel_expires
    
  •                || u->headers_in.x_accel_expires->value.len != 1
    
  •                || u->headers_in.x_accel_expires->value.data[0] != 
    

‘0’)
&& (u->headers_in.content_length_n == -1
|| (u->headers_in.content_length_n == tf->offset)))
{