mirror of
https://github.com/nginx/nginx.git
synced 2025-06-08 02:02:38 +08:00
Added warning about unset cache keys.
In fastcgi, scgi and uwsgi modules there are no default cache keys, and using a cache without a cache key set is likely meaningless.
This commit is contained in:
parent
d7d26feba1
commit
3a235bf52e
@ -2582,6 +2582,11 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
||||
conf->cache_key = prev->cache_key;
|
||||
}
|
||||
|
||||
if (conf->upstream.cache && conf->cache_key.value.data == NULL) {
|
||||
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
||||
"no \"fastcgi_cache_key\" for \"fastcgi_cache\"");
|
||||
}
|
||||
|
||||
ngx_conf_merge_value(conf->upstream.cache_lock,
|
||||
prev->upstream.cache_lock, 0);
|
||||
|
||||
|
@ -1337,6 +1337,11 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
||||
conf->cache_key = prev->cache_key;
|
||||
}
|
||||
|
||||
if (conf->upstream.cache && conf->cache_key.value.data == NULL) {
|
||||
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
||||
"no \"scgi_cache_key\" for \"scgi_cache\"");
|
||||
}
|
||||
|
||||
ngx_conf_merge_value(conf->upstream.cache_lock,
|
||||
prev->upstream.cache_lock, 0);
|
||||
|
||||
|
@ -1524,6 +1524,11 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
||||
conf->cache_key = prev->cache_key;
|
||||
}
|
||||
|
||||
if (conf->upstream.cache && conf->cache_key.value.data == NULL) {
|
||||
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
||||
"no \"uwsgi_cache_key\" for \"uwsgi_cache\"");
|
||||
}
|
||||
|
||||
ngx_conf_merge_value(conf->upstream.cache_lock,
|
||||
prev->upstream.cache_lock, 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user