# HG changeset patch # User Igor Sysoev # Date 1280827465 0 # Node ID 72cc5b789021962170f24f645edc18c07a8e56f7 # Parent d094e237abf4b68a1657fa9c98bb0e2259ad4464 inherit proxy_pass, fastcgi_pass, uwsgi_pass, scgi_pass inside a limit_except block if no handler was defined for the block diff -r d094e237abf4 -r 72cc5b789021 src/http/modules/ngx_http_fastcgi_module.c --- a/src/http/modules/ngx_http_fastcgi_module.c Mon Aug 02 15:28:04 2010 +0000 +++ b/src/http/modules/ngx_http_fastcgi_module.c Tue Aug 03 09:24:25 2010 +0000 @@ -2025,6 +2025,7 @@ ngx_keyval_t *src; ngx_hash_key_t *hk; ngx_hash_init_t hash; + ngx_http_core_loc_conf_t *clcf; ngx_http_script_compile_t sc; ngx_http_script_copy_code_t *copy; @@ -2270,6 +2271,13 @@ conf->fastcgi_values = prev->fastcgi_values; } + if (conf->upstream.upstream || conf->fastcgi_lengths) { + clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); + if (clcf->handler == NULL && clcf->lmt_excpt) { + clcf->handler = ngx_http_fastcgi_handler; + } + } + #if (NGX_PCRE) if (conf->split_regex == NULL) { conf->split_regex = prev->split_regex; diff -r d094e237abf4 -r 72cc5b789021 src/http/modules/ngx_http_proxy_module.c --- a/src/http/modules/ngx_http_proxy_module.c Mon Aug 02 15:28:04 2010 +0000 +++ b/src/http/modules/ngx_http_proxy_module.c Tue Aug 03 09:24:25 2010 +0000 @@ -1720,6 +1720,7 @@ size_t size; ngx_keyval_t *s; ngx_hash_init_t hash; + ngx_http_core_loc_conf_t *clcf; ngx_http_proxy_redirect_t *pr; ngx_http_script_compile_t sc; @@ -2022,6 +2023,13 @@ conf->vars = prev->vars; } + if (conf->upstream.upstream || conf->proxy_lengths) { + clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); + if (clcf->handler == NULL && clcf->lmt_excpt) { + clcf->handler = ngx_http_proxy_handler; + conf->location = prev->location; + } + } if (conf->body_source.data == NULL) { conf->body_source = prev->body_source; diff -r d094e237abf4 -r 72cc5b789021 src/http/modules/ngx_http_scgi_module.c --- a/src/http/modules/ngx_http_scgi_module.c Mon Aug 02 15:28:04 2010 +0000 +++ b/src/http/modules/ngx_http_scgi_module.c Tue Aug 03 09:24:25 2010 +0000 @@ -1053,6 +1053,7 @@ ngx_keyval_t *src; ngx_hash_key_t *hk; ngx_hash_init_t hash; + ngx_http_core_loc_conf_t *clcf; ngx_http_script_compile_t sc; ngx_http_script_copy_code_t *copy; @@ -1285,6 +1286,13 @@ conf->scgi_values = prev->scgi_values; } + if (conf->upstream.upstream || conf->scgi_lengths) { + clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); + if (clcf->handler == NULL && clcf->lmt_excpt) { + clcf->handler = ngx_http_scgi_handler; + } + } + if (conf->params_source == NULL) { conf->flushes = prev->flushes; conf->params_len = prev->params_len; diff -r d094e237abf4 -r 72cc5b789021 src/http/modules/ngx_http_uwsgi_module.c --- a/src/http/modules/ngx_http_uwsgi_module.c Mon Aug 02 15:28:04 2010 +0000 +++ b/src/http/modules/ngx_http_uwsgi_module.c Tue Aug 03 09:24:25 2010 +0000 @@ -1106,6 +1106,7 @@ ngx_keyval_t *src; ngx_hash_key_t *hk; ngx_hash_init_t hash; + ngx_http_core_loc_conf_t *clcf; ngx_http_script_compile_t sc; ngx_http_script_copy_code_t *copy; @@ -1340,6 +1341,13 @@ conf->uwsgi_values = prev->uwsgi_values; } + if (conf->upstream.upstream || conf->uwsgi_lengths) { + clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); + if (clcf->handler == NULL && clcf->lmt_excpt) { + clcf->handler = ngx_http_uwsgi_handler; + } + } + ngx_conf_merge_uint_value(conf->modifier1, prev->modifier1, 0); ngx_conf_merge_uint_value(conf->modifier2, prev->modifier2, 0); diff -r d094e237abf4 -r 72cc5b789021 src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c Mon Aug 02 15:28:04 2010 +0000 +++ b/src/http/ngx_http_core_module.c Tue Aug 03 09:24:25 2010 +0000 @@ -3908,6 +3908,7 @@ clcf->loc_conf = ctx->loc_conf; clcf->name = pclcf->name; clcf->noname = 1; + clcf->lmt_excpt = 1; if (ngx_http_add_location(cf, &pclcf->locations, clcf) != NGX_OK) { return NGX_CONF_ERROR; diff -r d094e237abf4 -r 72cc5b789021 src/http/ngx_http_core_module.h --- a/src/http/ngx_http_core_module.h Mon Aug 02 15:28:04 2010 +0000 +++ b/src/http/ngx_http_core_module.h Tue Aug 03 09:24:25 2010 +0000 @@ -286,6 +286,7 @@ #endif unsigned noname:1; /* "if () {}" block or limit_except */ + unsigned lmt_excpt:1; unsigned named:1; unsigned exact_match:1;