Welcome! Log In Create A New Profile

Advanced

[nginx] Added warning about unset cache keys.

Maxim Dounin
September 11, 2014 12:44PM
details: http://hg.nginx.org/nginx/rev/906530c9ffd2
branches:
changeset: 5829:906530c9ffd2
user: Maxim Dounin <mdounin@mdounin.ru>
date: Thu Sep 11 20:08:52 2014 +0400
description:
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.

diffstat:

src/http/modules/ngx_http_fastcgi_module.c | 5 +++++
src/http/modules/ngx_http_scgi_module.c | 5 +++++
src/http/modules/ngx_http_uwsgi_module.c | 5 +++++
3 files changed, 15 insertions(+), 0 deletions(-)

diffs (45 lines):

diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -2582,6 +2582,11 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf
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);

diff --git a/src/http/modules/ngx_http_scgi_module.c b/src/http/modules/ngx_http_scgi_module.c
--- a/src/http/modules/ngx_http_scgi_module.c
+++ b/src/http/modules/ngx_http_scgi_module.c
@@ -1337,6 +1337,11 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t
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);

diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -1524,6 +1524,11 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t
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);


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Added warning about unset cache keys.

Maxim Dounin 652 September 11, 2014 12:44PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 139
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready