diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-04-30 16:43:38 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-04-30 16:43:38 +0400 |
commit | 06d4aa1883034b6117a29887bc90a74ae433f3fd (patch) | |
tree | f80f3f5ddb2527c444eebb91911d41ea62682bd6 /src/http/modules | |
parent | 5461f39381f20cf0f4d04a36e22aea6dd2ba10a4 (diff) |
*) check a proxy_redirect single parameter
*) warn about "proxy_redirect false"
Diffstat (limited to 'src/http/modules')
-rw-r--r-- | src/http/modules/ngx_http_proxy_module.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c index 628b32d4a..fc67a67af 100644 --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -2675,10 +2675,26 @@ ngx_http_proxy_redirect(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) value = cf->args->elts; - if (ngx_strcmp(value[1].data, "off") == 0) { - plcf->redirect = 0; - plcf->redirects = NULL; - return NGX_CONF_OK; + if (cf->args->nelts == 2) { + if (ngx_strcmp(value[1].data, "off") == 0) { + plcf->redirect = 0; + plcf->redirects = NULL; + return NGX_CONF_OK; + } + + if (ngx_strcmp(value[1].data, "false") == 0) { + ngx_conf_log_error(NGX_LOG_ERR, cf, 0, + "invalid parameter \"false\", use \"off\" instead"); + plcf->redirect = 0; + plcf->redirects = NULL; + return NGX_CONF_OK; + } + + if (ngx_strcmp(value[1].data, "default") != 0) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "invalid parameter \"%V\"", &value[1]); + return NGX_CONF_ERROR; + } } if (plcf->redirects == NULL) { @@ -2694,7 +2710,7 @@ ngx_http_proxy_redirect(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) return NGX_CONF_ERROR; } - if (cf->args->nelts == 2 && ngx_strcmp(value[1].data, "default") == 0) { + if (ngx_strcmp(value[1].data, "default") == 0) { if (plcf->url.data == NULL) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "\"proxy_rewrite_location default\" must go " |