Forum: NGINX Upstream: switch off proxy_store if upstream said to

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2008-10-27 16:01
(Received via mailing list)
# HG changeset patch
# User Maxim Dounin <mdounin@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)))
             {
This topic is locked and can not be replied to.