mirror of
https://github.com/nginx/nginx.git
synced 2025-06-16 16:51:05 +08:00
fix noregex for inclusive locations
This commit is contained in:
parent
916ee8ecea
commit
9a70242f07
@ -1122,13 +1122,28 @@ ngx_http_core_find_location(ngx_http_request_t *r)
|
|||||||
{
|
{
|
||||||
ngx_int_t rc;
|
ngx_int_t rc;
|
||||||
ngx_http_core_loc_conf_t *pclcf;
|
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);
|
pclcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
||||||
|
|
||||||
rc = ngx_http_core_find_static_location(r, pclcf->static_locations);
|
rc = ngx_http_core_find_static_location(r, pclcf->static_locations);
|
||||||
|
|
||||||
if (rc == NGX_AGAIN) {
|
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 */
|
/* look up nested locations */
|
||||||
|
|
||||||
rc = ngx_http_core_find_location(r);
|
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 */
|
/* rc == NGX_DECLINED or rc == NGX_AGAIN in nested location */
|
||||||
|
|
||||||
#if (NGX_PCRE)
|
#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 (noregex == 0 && pclcf->regex_locations) {
|
||||||
|
|
||||||
if (clcf->noregex == 0 && pclcf->regex_locations) {
|
|
||||||
|
|
||||||
for (clcfp = pclcf->regex_locations; *clcfp; clcfp++) {
|
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);
|
return ngx_http_core_find_location(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user