]> git.kaiwu.me - nginx.git/commitdiff
Handle nested location lookup error
authorRoman Arutyunyan <arut@nginx.com>
Wed, 9 Sep 2026 14:23:22 +0000 (18:23 +0400)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Thu, 10 Sep 2026 08:10:38 +0000 (12:10 +0400)
Previously, when looking up a nested location after a prefix location
match, the nested regex or predicate match error could be ignored if
more regex or predicate locations were configured at the current level.
Now such error leads to request finalization.

src/http/ngx_http_core_module.c

index 1bd8a55ab3c72a224c9f926da1f66817bc14a04e..504e49eb226c468771274c700fefdbf94f61e6d8 100644 (file)
@@ -1470,7 +1470,7 @@ ngx_http_core_find_location(ngx_http_request_t *r)
         rc = ngx_http_core_find_location(r);
     }
 
-    if (rc == NGX_OK || rc == NGX_DONE) {
+    if (rc == NGX_OK || rc == NGX_DONE || rc == NGX_ERROR) {
         return rc;
     }