nginx-proxy-manager/docs
Tom Winnerl 798596ec79 fix(review): allow variable forward paths on regex and named locations
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>
2026-11-14 09:03:56 +01:00
..
.vitepress docs: custom location modes and statuses 2026-11-14 09:03:56 +01:00
scripts Docs update, use package version instead of latest, refer to better mariadb image 2026-02-19 08:36:41 +10:00
src fix(review): allow variable forward paths on regex and named locations 2026-11-14 09:03:56 +01:00
.gitignore Migrate from vuepress to vitepress for docs site 2024-05-10 23:00:27 +10:00
package.json Docs update, use package version instead of latest, refer to better mariadb image 2026-02-19 08:36:41 +10:00
yarn.lock Update dependencies 2026-11-09 11:55:20 +10:00