diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2011-11-01 14:19:13 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2011-11-01 14:19:13 +0000 |
| commit | d3769b1966ea0077360034b918275292d587e738 (patch) | |
| tree | c9ab024fff643c180a54f9135a7ba0715b9b58f5 /src | |
| parent | 9b3014e024182da03b88bc77b1c17031e27d429e (diff) | |
| download | nginx-d3769b1966ea0077360034b918275292d587e738.tar.gz nginx-d3769b1966ea0077360034b918275292d587e738.tar.bz2 | |
Merging r4209:
Skipping location rewrite phase for server null location.
Diffstat (limited to 'src')
| -rw-r--r-- | src/http/modules/ngx_http_rewrite_module.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c index 5164734f2..2ef24405c 100644 --- a/src/http/modules/ngx_http_rewrite_module.c +++ b/src/http/modules/ngx_http_rewrite_module.c @@ -135,10 +135,22 @@ ngx_module_t ngx_http_rewrite_module = { static ngx_int_t ngx_http_rewrite_handler(ngx_http_request_t *r) { + ngx_int_t index; ngx_http_script_code_pt code; ngx_http_script_engine_t *e; + ngx_http_core_srv_conf_t *cscf; + ngx_http_core_main_conf_t *cmcf; ngx_http_rewrite_loc_conf_t *rlcf; + cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); + cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); + index = cmcf->phase_engine.location_rewrite_index; + + if (r->phase_handler == index && r->loc_conf == cscf->ctx->loc_conf) { + /* skipping location rewrite phase for server null location */ + return NGX_DECLINED; + } + rlcf = ngx_http_get_module_loc_conf(r, ngx_http_rewrite_module); if (rlcf->codes == NULL) { |
