aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-08-17 17:58:16 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-08-17 17:58:16 +0000
commit9a70242f071ade418eef6abf6fae477e5a424fe5 (patch)
treed9650296ba5d04637ea006cefd7bffc981d7e5dc /src/http/ngx_http_core_module.c
parent916ee8ecea1728b23dbd2c11d9ca8242b593d32a (diff)
downloadnginx-9a70242f071ade418eef6abf6fae477e5a424fe5.tar.gz
nginx-9a70242f071ade418eef6abf6fae477e5a424fe5.zip
fix noregex for inclusive locations
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 776438ba0..2379dcc89 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1122,13 +1122,28 @@ ngx_http_core_find_location(ngx_http_request_t *r)
{
ngx_int_t rc;
ngx_http_core_loc_conf_t *pclcf;
+#if (NGX_PCRE)
+ ngx_int_t n;
+ ngx_uint_t noregex;
+ ngx_http_core_loc_conf_t *clcf, **clcfp;
+
+ noregex = 0;
+#endif
pclcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
rc = ngx_http_core_find_static_location(r, pclcf->static_locations);
if (rc == NGX_AGAIN) {
+
+#if (NGX_PCRE)
+ clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
+
+ noregex = clcf->noregex;
+#endif
+
/* look up nested locations */
+
rc = ngx_http_core_find_location(r);
}
@@ -1139,13 +1154,8 @@ ngx_http_core_find_location(ngx_http_request_t *r)
/* rc == NGX_DECLINED or rc == NGX_AGAIN in nested location */
#if (NGX_PCRE)
- {
- ngx_int_t n;
- ngx_http_core_loc_conf_t *clcf, **clcfp;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
- if (clcf->noregex == 0 && pclcf->regex_locations) {
+ if (noregex == 0 && pclcf->regex_locations) {
for (clcfp = pclcf->regex_locations; *clcfp; clcfp++) {
@@ -1175,7 +1185,6 @@ ngx_http_core_find_location(ngx_http_request_t *r)
return ngx_http_core_find_location(r);
}
}
- }
#endif
return rc;