Using proxy_cache_background_update

Maxim Dounin mdounin at mdounin.ru
Mon Feb 27 03:02:07 UTC 2017


Hello!

On Sun, Feb 26, 2017 at 01:08:02PM -0500, jeanpaul wrote:

> I stripped down my configuration and removed 'unneeded' parts to reproduce.
> 
> I'm able to reproduce it with the following settings:
> 
>     location / {
>      # Added to mitigate the issue. Removed for testing
>      #rewrite ^/index.html$ / break;
> 
>      proxy_pass  http://backends;

[...]

>      # Removing the if construction and leaving the "expires" in place
> solves the issue!
>      if ($no_cache = "") {
>        expires               1s;
>      }

Ok, thanks for tracing this, looks clear enough now.  Please try 
the following patch:

diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -2571,6 +2571,7 @@ ngx_http_subrequest(ngx_http_request_t *
         sr->method_name = r->method_name;
         sr->loc_conf = r->loc_conf;
         sr->valid_location = r->valid_location;
+        sr->content_handler = r->content_handler;
         sr->phase_handler = r->phase_handler;
         sr->write_event_handler = ngx_http_core_run_phases;
 

-- 
Maxim Dounin
http://nginx.org/


More information about the nginx mailing list