proxy_cache_background_update after cache expiry

IgorR nginx-forum at
Wed Apr 5 11:32:01 UTC 2017


I'm trying to configure nginx to use proxy_cache_background_update but it
seems like after expiry it still waits for the full roundtrip to the
backend, returning a MISS in X-Cache-Status. What am I MISSing?

I'm using nginx 1.11.12 under ubuntu 14.04 running inside docker, but
hopefully this is too much detail.

location ~ ^/?(\d+/[^/]+)?/?$
   expires 20s;

   proxy_cache app_cache;
   proxy_cache_lock on;

   proxy_cache_bypass $http_upgrade;

   proxy_http_version 1.1;
   error_log    /nginxerror.log debug;

   add_header X-Cache-Status $upstream_cache_status;

   proxy_cache_use_stale error timeout updating http_500 http_502 http_503
   proxy_cache_background_update on;


NB: This is a duplicate of my so question, I was kindly advised on the nginx
IRC to repost here for better chances, the original question is here:

Posted at Nginx Forum:,273417,273417#msg-273417

More information about the nginx mailing list