diff src/http/modules/ngx_http_uwsgi_module.c @ 6906:1aeaae6e9446

Upstream: proxy_cache_background_update and friends. The directives enable cache updates in subrequests.
author Roman Arutyunyan <arut@nginx.com>
date Fri, 10 Feb 2017 15:13:41 +0300
parents 0fba3ed4e7eb
children fa56ab75cffc
line wrap: on
line diff
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -379,6 +379,13 @@ static ngx_command_t ngx_http_uwsgi_comm
       offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_revalidate),
       NULL },
 
+    { ngx_string("uwsgi_cache_background_update"),
+      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+      ngx_conf_set_flag_slot,
+      NGX_HTTP_LOC_CONF_OFFSET,
+      offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_background_update),
+      NULL },
+
 #endif
 
     { ngx_string("uwsgi_temp_path"),
@@ -1425,6 +1432,7 @@ ngx_http_uwsgi_create_loc_conf(ngx_conf_
     conf->upstream.cache_lock_timeout = NGX_CONF_UNSET_MSEC;
     conf->upstream.cache_lock_age = NGX_CONF_UNSET_MSEC;
     conf->upstream.cache_revalidate = NGX_CONF_UNSET;
+    conf->upstream.cache_background_update = NGX_CONF_UNSET;
 #endif
 
     conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
@@ -1720,6 +1728,9 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t
     ngx_conf_merge_value(conf->upstream.cache_revalidate,
                               prev->upstream.cache_revalidate, 0);
 
+    ngx_conf_merge_value(conf->upstream.cache_background_update,
+                              prev->upstream.cache_background_update, 0);
+
 #endif
 
     ngx_conf_merge_value(conf->upstream.pass_request_headers,