aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-08-17 18:02:55 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-08-17 18:02:55 +0000
commitdc911287e8f6173271fa35e8f9d8fd4fa7279e08 (patch)
tree67ee7d9424d387a369f53ebdea703460b4c6bede /src/http/ngx_http_core_module.c
parent9a70242f071ade418eef6abf6fae477e5a424fe5 (diff)
downloadnginx-dc911287e8f6173271fa35e8f9d8fd4fa7279e08.tar.gz
nginx-dc911287e8f6173271fa35e8f9d8fd4fa7279e08.zip
*) regex match must return NGX_OK to stop regex searching,
this fixes inclusive regex location *) change NGX_HTTP_INTERNAL_SERVER_ERROR to NGX_ERROR
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 2379dcc89..cd4b8ed93 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -789,7 +789,7 @@ ngx_http_core_find_config_phase(ngx_http_request_t *r,
rc = ngx_http_core_find_location(r);
- if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) {
+ if (rc == NGX_ERROR) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
return NGX_OK;
}
@@ -1117,6 +1117,14 @@ ngx_http_update_location_config(ngx_http_request_t *r)
}
+/*
+ * NGX_OK - exact or regex match
+ * NGX_DONE - auto redirect
+ * NGX_AGAIN - inclusive match
+ * NGX_ERROR - regex error
+ * NGX_DECLINED - no match
+ */
+
static ngx_int_t
ngx_http_core_find_location(ngx_http_request_t *r)
{
@@ -1173,7 +1181,7 @@ ngx_http_core_find_location(ngx_http_request_t *r)
ngx_regex_exec_n
" failed: %d on \"%V\" using \"%V\"",
n, &r->uri, &(*clcfp)->name);
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ return NGX_ERROR;
}
/* match */
@@ -1182,7 +1190,9 @@ ngx_http_core_find_location(ngx_http_request_t *r)
/* look up nested locations */
- return ngx_http_core_find_location(r);
+ rc = ngx_http_core_find_location(r);
+
+ return (rc == NGX_ERROR) ? rc : NGX_OK;
}
}
#endif