[PATCH 6 of 6] Upstream: switch off proxy_store if upstream said to

Maxim Dounin mdounin at mdounin.ru
Mon Oct 27 17:53:26 MSK 2008


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# 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)))
             {





More information about the nginx mailing list