summaryrefslogtreecommitdiff
path: root/src/http/ngx_http_upstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_upstream.c')
-rw-r--r--src/http/ngx_http_upstream.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index e8d87738f..62f1669c7 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -666,6 +666,15 @@ ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u)
ngx_http_file_cache_create_key(r);
+ if (r->cache->header_start >= u->conf->buffer_size) {
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+ "cache key too large, increase upstream buffer size %uz",
+ u->conf->buffer_size);
+
+ r->cache = NULL;
+ return NGX_DECLINED;
+ }
+
u->cacheable = 1;
c = r->cache;