mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-11-19 14:40:27 +00:00
Problem: preflightLocation() quarantined every regex (`~`, `~*`) or named
(`@x`) location that had a forward path, so a working setup such as
`location ~ ^/api/(.*)$` with forward path `/v1/$1`, or `@fallback` with
`/fb$request_uri`, answered 503 after the upgrade. nginx only rejects a URI
in the proxy_pass of such a location when the proxy_pass has no variable
("cannot have URI part in location given by regular expression"); with a
variable it is compiled as a script and has always worked.
Fix: the check only quarantines a forward path without a `$`. A forward
path with a variable is rendered literally, exactly as before, through the
previous fix (static mode, no rewrite; no nested asset location when it uses
a capture, because the nested regex would replace $1). The messages and the
nginx error hint now say "without an nginx variable" and suggest a capture.
Tests: unit tests for the preflight (literal path still quarantined, `$1`,
named captures, `$request_uri`, named locations allowed) and the rendering.
The nginx-semantics generator now applies preflightLocation() like the
backend does, and new cases (`~ ^/rx/(.*)$` -> `/v1/$1`, `~*` with a named
capture, a cached regex location, `@fb` reached through error_page) must
answer like the old literal rendering: 9 diffs before, DIFFS=0 now.
Cypress (ProxyHostLocations): `~ ^/cap/(.*)$` with forward path `/$1` is
saved ok and `/cap/dashboard` serves examplesite's /dashboard.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| .vitepress | ||
| scripts | ||
| src | ||
| .gitignore | ||
| package.json | ||
| yarn.lock | ||