summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_upstream.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2014-12-26 16:22:59 +0300
committerValentin Bartenev <vbart@nginx.com>2014-12-26 16:22:59 +0300
commit843fb552ecf53836b5205bec26513cba46ca59f8 (patch)
treec688bb50c8b0f7693ff2197fd7b75546769593de /src/http/ngx_http_upstream.c
parent1858857c25dc38be78b2f008c9f496246a8f8c9f (diff)
downloadnginx-843fb552ecf53836b5205bec26513cba46ca59f8.tar.gz
nginx-843fb552ecf53836b5205bec26513cba46ca59f8.tar.bz2
Upstream: use_temp_path parameter of proxy_cache_path and friends.
When set to "off", temporary files for cacheable responses will be stored inside cache directory.
Diffstat (limited to 'src/http/ngx_http_upstream.c')
-rw-r--r--src/http/ngx_http_upstream.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 67d07e58c..5dd2bfb7c 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2677,6 +2677,14 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
if (p->cacheable) {
p->temp_file->persistent = 1;
+#if (NGX_HTTP_CACHE)
+ if (r->cache && !r->cache->file_cache->use_temp_path) {
+ p->temp_file->file.name = r->cache->file.name;
+ p->temp_file->path = r->cache->file_cache->path;
+ p->temp_file->prefix = 1;
+ }
+#endif
+
} else {
p->temp_file->log_level = NGX_LOG_WARN;
p->temp_file->warn = "an upstream response is buffered "