]> git.kaiwu.me - nginx.git/commitdiff
update r3945 with more descriptive error message
authorIgor Sysoev <igor@sysoev.ru>
Fri, 29 Jul 2011 15:33:03 +0000 (15:33 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 29 Jul 2011 15:33:03 +0000 (15:33 +0000)
src/http/modules/ngx_http_fastcgi_module.c
src/http/modules/ngx_http_proxy_module.c
src/http/modules/ngx_http_scgi_module.c
src/http/modules/ngx_http_uwsgi_module.c
src/http/ngx_http_upstream.c
src/http/ngx_http_upstream.h

index 12d5b1d8f2bffe256bce827608f452c05714f138..71194fd20019e638f7b5c8b659ec9b8de02ebebb 100644 (file)
@@ -2003,6 +2003,8 @@ ngx_http_fastcgi_create_loc_conf(ngx_conf_t *cf)
 
     conf->catch_stderr = NGX_CONF_UNSET_PTR;
 
+    ngx_str_set(&conf->upstream.module, "fastcgi");
+
     return conf;
 }
 
index 214fe6a26de294ef35979e9e2f7b0642a1339cf0..147422af88ac2594b37a2fde9cdb00cb70d7d78a 100644 (file)
@@ -1707,6 +1707,8 @@ ngx_http_proxy_create_loc_conf(ngx_conf_t *cf)
     conf->headers_hash_max_size = NGX_CONF_UNSET_UINT;
     conf->headers_hash_bucket_size = NGX_CONF_UNSET_UINT;
 
+    ngx_str_set(&conf->upstream.module, "proxy");
+
     return conf;
 }
 
index d745551f2a4479b2992be1c4073b80a9ca5c0db0..c83d77044a1bb0425993ac0624851fcf7c5d4c89 100644 (file)
@@ -1030,6 +1030,8 @@ ngx_http_scgi_create_loc_conf(ngx_conf_t *cf)
     /* "scgi_cyclic_temp_file" is disabled */
     conf->upstream.cyclic_temp_file = 0;
 
+    ngx_str_set(&conf->upstream.module, "scgi");
+
     return conf;
 }
 
index cd3c7c1244da68bddd00d2539ee86270181e9b72..a907e53b8ba00a25a7a44fc162dc0aeb78997e2c 100644 (file)
@@ -1083,6 +1083,8 @@ ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf)
     /* "uwsgi_cyclic_temp_file" is disabled */
     conf->upstream.cyclic_temp_file = 0;
 
+    ngx_str_set(&conf->upstream.module, "uwsgi");
+
     return conf;
 }
 
index 42b351c4d18575b4aa80cc10bc66d62929ddc193..29432dc14a3985d2d9e9aefa87082a2bff337cfc 100644 (file)
@@ -661,10 +661,12 @@ 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) {
+        if (r->cache->header_start + 256 >= 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);
+                          "%V_buffer_size %uz is not enough for cache key, "
+                          "it should increased at least to %uz",
+                          &u->conf->module, u->conf->buffer_size,
+                          ngx_align(r->cache->header_start + 256, 1024));
 
             r->cache = NULL;
             return NGX_DECLINED;
index 01e2e1e518da0fc028e93683769108bd6c758020..fa848c0d3c5a624e57850115bee556102c777827 100644 (file)
@@ -179,6 +179,7 @@ typedef struct {
     ngx_flag_t                       ssl_session_reuse;
 #endif
 
+    ngx_str_t                        module;
 } ngx_http_upstream_conf_t;