Commit graph

232 commits

Author SHA1 Message Date
Tom Winnerl
3d56787f40 fix(review): keep $uri of cached assets of a location with a forward path
The nested asset location of a location with Cache Assets and a forward
path always runs `rewrite ... break` (nginx forbids a URI part in
proxy_pass inside a regex location), so its copy of the advanced config saw
the forwarded path in $uri (/v1/app.css) while the location itself, static,
saw /api/app.css.

The asset location now sets $npm_loc_<i>_uri to $uri before anything else,
and its copy of the advanced config reads that variable instead of $uri,
${uri}, $document_uri and ${document_uri} (token ranges from the nginx
tokenizer, not in comments or *_by_lua_block bodies). The location itself is
unchanged. Docs name the remaining limits (settings inherited from a
top-level include, Lua ngx.var.uri). New harness case /curi/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
8fb231890b fix(review): keep a location static when an included file reads $uri
chooseLocationMode() looked for $uri / $document_uri only in the location's
advanced config, so a location with a forward path whose included snippet
reads $uri (proxy_set_header X-Original-URI $uri;) was rendered dynamic and
the rewrite changed what the snippet sent on a healthy upstream. The include
reader now reports usesUriVariable for any statement of an included file
(nested includes too), and the location stays static then, as for the
variable written directly. Docs say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
6d02ea2168 fix(review): keep stored forward hosts that combine text and a variable
A location saved before v2.17 with forward host `app-$stage` (and
`set $stage prod;` in its advanced config) answered 503 after the startup
regeneration: preflightLocation() only allowed a host that is exactly one
`$name` and quarantined every other host with a `$`. The renderer before
custom location modes, and develop, write any stored value that can't add
directives literally (`proxy_pass http://app-$stage:80;`), which works.

isVariableHost() now accepts a forward host with an nginx variable that has
none of the characters that would break out of the directive, the same
structural rule as lib/nginx-values.js applies to stored rows: such a host
is rendered literally (static, no DNS check, no rewrite) as `$backend` is,
also with NPM_LOCATION_DYNAMIC_DNS=false. Braces (`app-${stage}`), spaces
and `;` are still quarantined. The API refuses `$` in a forward host since
v2.17, so this only concerns rows saved before. The frontend's
isVariableHost() follows the same rule (no upstream check for such hosts).

Tests: unit tests for the preflight, mode and rendering; nginx semantics
harness cases /varmix/, /varmixfp/ and /vmrx/ (`ec$semhost`) compared with
the legacy rendering (they answered 503 before, DIFFS=0 now).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
063dd7618a fix(review): quarantine a location whose included snippet is broken
A custom location with `include /snippets/app.conf;` whose file has an
error (eg. an unknown directive) still rejected the whole host save: nginx
names the included file (`/snippets/app.conf:1`), which is no host's
config, so configureHost() treated it as a global error and never tried
the location isolation. Unrelated changes to the host could not be saved,
although replacing that location with a 503 stub lets the host work.

For an error in a file that is no host's config, configureHost() now runs
isolateFaultyLocations() over the locations whose advanced config has an
`include` statement (comments don't count): the location that brings the
error back is quarantined and the host stays online. When the error stays
with all of them stubbed (eg. a broken file that nginx.conf includes) it
stays a global error, and a host without such locations costs no extra
nginx -t.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
abcf0af67c i18n(locations): translatable location check messages
The state of a custom location (location editor, save warning, host
status popover) showed the backend's English sentence in every language.

Backend: every entry of meta.nginx_locations now has a stable `code`
(empty_path, empty_host, invalid_host, invalid_path, unbalanced_braces,
regex_forward_path, named_forward_path, unresolved, rejected, omitted)
and `params` (`host` for unresolved, nginx's error as `detail` for
rejected and omitted, a sentence of its own like a host-level error's
detail) next to the English `message`, which stays for API users and
logs. An unsafe location value names its field (location_path,
location_forward_host, location_forward_path) like the host's own. OpenAPI schema, docs, unit tests and the Cypress spec
cover the new fields.

Frontend: the text comes from location-check.<code> (en, de, et, vi;
invalid_path and rejected reuse location.error.path-invalid and
location-status.quarantined.default), nginx's own error is shown below
it untranslated. An unknown code shows the backend's message.

The English plurals of "+{count} locations", "{count} problems" and the
two save warnings use `=1 {...}`, so languages without a "one" category
(ja, zh, ko, id) that fall back to English read "1 location", not
"1 locations".

A host rejected because of a custom location ('Custom location "/api"
advanced configuration: ... (line 2).') is worded by describeNginxError()
from the details' area (location, location_advanced), location_path and
relative_line: nginx-error.location and
nginx-error.location-advanced-line (en, de, et, vi), nginx's error below
it untranslated. The hint of the regex/named forward path rule follows
its new English text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
74dc14841a chore: adapt to develop nginx-values (location values the API accepts)
v2.17 validates custom location paths, forward hosts and forward paths in
the API schema (lib/nginx-values.js) and maps $forward_host from $host.

- frontend: the location editor checks what the API now refuses, so the
  user gets an inline error instead of a 400: no "$" (nginx variable) in
  the forward host, no braces (`${name}`) or control characters in the
  forward path, the location path rule of the API, and these checks also
  for a disabled row (the schema checks every row). Path and forward host
  are trimmed before sending, the schema refuses surrounding whitespace.
  location.error.host-invalid no longer says a single variable is allowed
- backend: location paths are read with nginx's escapes (`/a\;b`,
  `"/a\"b"`, `/a\\b`, which the API accepts), and the dynamic rewrite
  writes a backslash of the path as \x5c, so it matches the URI nginx
  matched the location with
- tests of the advanced config check of non-admins follow upstream's
  value matching (renames keep the config, swapping and clearing are
  allowed, copies are refused); a location sent without a config keeps
  the one of the n-th saved location for the n-th repeated (regex) path
- new test: the accepted values of nginx-values.test.js rendered through
  the location renderer in static, dynamic and asset-cache mode keep the
  statement structure, and the dynamic rewrite matches escaped paths
- nginx semantics harness: upstream's $forward_host map, upper-case Host
  requests, escaped and quoted location paths (DIFFS=0)
- docs: a variable forward host only renders for locations saved before
  v2.17, braced variables in the forward path are refused
- generateConfig checks a host's locations as they are rendered
  (prepareLocation(): trimmed, "host/path" split): a stored `/api ` or
  `app ` renders and is safe, so the startup reconcile after an upgrade
  doesn't take such hosts offline; an empty path or forward host is left
  to the per-location quarantine instead of taking the whole host offline
- ProxyHostLocations.cy.js: the duplicate path case sends `/same` twice,
  the schema refuses surrounding whitespace before the duplicate check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
66fd585a3f fix(review): honour a proxy_redirect from an included file
In dynamic mode (the default whenever a resolver exists) a location writes
its own `proxy_redirect <upstream> /` line unless hasDirective() finds a
proxy_redirect in the advanced config text. An advanced config with
`include /snippets/x.conf;` whose file has `proxy_redirect off;` then
failed nginx -t ("proxy_redirect" directive is duplicate; develop passes)
and the location was quarantined (503). An included rule with a value got
NPM's line next to it, which the literal rendering doesn't have (no
implicit "proxy_redirect default" once a rule is set).

lib/nginx-includes.js reads the files the top-level includes of a
location's advanced config bring in, as nginx does: relative paths from
the config prefix /etc/nginx/ (also in nested includes), globs as glob(3)
expands them (no match is no error, a wildcard doesn't match a leading
dot, `\` escapes), nested includes up to 16 levels, only the top-level
statements of each file (the location context), read with the Lua-aware
tokenizer. One reader per computeLocationStates() / renderLocations()
call caches the files; the file access is injectable for the tests.

Rendering is synchronous, so a read must never block or run away: only
regular files up to 4 MiB are read (stat first, then open O_NONBLOCK and
fstat again). A character or block device (/dev/null, /dev/zero,
/dev/urandom) is never opened and reads as empty, as nginx reads st_size
bytes, 0 for a device. A FIFO, a socket or a bigger file is unreadable.

A proxy_redirect at the top level of an included file counts as the
user's: no npm_redirect line (the nested asset location already sets none
with an include and inherits the location's). An include that can't be
read (missing file, no permission, a directory a glob can't list, wrong
number of arguments, a cycle or deeper nesting) keeps the location static
while its host resolves, as before dynamic locations; an unresolved host
stays dynamic and fails closed as before.

Tests: the reader (off, a value, nested and relative includes, globs,
missing / unreadable files and directories, cycle, depth, caching,
devices, FIFO, socket, size limit) and
the rendering and mode choice with it; harness cases for dynamic locations
that include `proxy_redirect off;` (directly, through a glob and a nested
include, with Cache Assets) and a rule that matches nothing: nginx -t
passes and the Location header is the same as static and legacy. Docs:
docs/src/advanced-config/locations.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
725f963eb3 fix(review): tokenize *_by_lua_block bodies as Lua
lib/nginx-tokenize.js read the body of an access_by_lua_block,
set_by_lua_block $v, rewrite_by_lua_block, ... with nginx's rules, but
lua-nginx-module reads it with a Lua lexer of its own. Valid OpenResty
blocks were quarantined as "unbalanced { } braces" before nginx was asked:
a `}` in a Lua comment (`-- deny unless header }`), a `#t` (no comment in
Lua), strings with braces, long strings and comments ([[...]], [==[...]==],
--[[...]]).

The tokenizer now skips the block of every directive ending in
_by_lua_block (ssl_*, balancer_, log_, ... included) the way
ngx_http_lua_conf_lua_block_parse() does: `{` / `}` count outside of
one-line "..." / '...' strings, long brackets with the same level and
`--` comments. The Lua block is one statement (lua: true) with its end
offset and no statements inside, so the brace check, the asset copy of the
advanced config (the block is repeated as it is) and the include / log path
check (Lua code is not read as directives) see it as nginx does. An
unclosed Lua block or long bracket counts as unbalanced. The header comment of
lib/nginx-advanced.js and docs/src/advanced-config/locations.md no longer
say a quote in a Lua comment can hide the directives after the block from
the include / log path check.

Tests: tokenizer cases checked against nginx -t of openresty 1.31 (blocks
that pass and blocks that fail), every *_by_lua_block form, the brace
check, a Lua guard repeated in the asset location with and without an
include; harness cases for an access_by_lua_block guard with a `}` in a
comment on cached assets, with and without an include.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
7bca4cc170 fix(review): run cached assets of a location through its whole advanced config
The nested asset location of a custom location with "Cache Assets" only
repeated the top-level `set` statements of the advanced config. nginx runs
none of a parent's rewrite-phase directives in a nested location, so an
`if (...) { return 403; }` guard, a `rewrite` or a `set` inside an `if` were
skipped for assets: `^~ /private/` with `set $backend app; if
($http_x_token != secret) { return 403; }` served /private/file.css without
the token.

The asset location now repeats the location's whole body (templates/
_location_body.conf): the advanced config at the same place before the proxy
directives, the access list, headers, exploit / SSL / HSTS includes and the
proxy settings, plus the cache settings. assetSetDirectives() is gone.

- top-level `location` blocks of the advanced config are left out of the
  copy (nginx rejects a prefix location inside a regex location); their lines
  stay as empty lines so error lines still map to the advanced config
- a cache directive the advanced config sets itself at the top level
  (expires, proxy_cache, proxy_read_timeout, ...) is left out of the cache
  block: nginx rejects most of them twice, and the location's value applies
- an advanced config with a top-level `include` is not repeated as a whole:
  the included file is unknown here, and a second copy of it fails nginx -t
  (Authelia's proxy.conf: "proxy_read_timeout" directive is duplicate; an
  included `expires`; an included `location`, "is outside location"). The
  nested location then repeats the advanced config without the includes and
  without the list settings a nested location only inherits while it sets
  none of its own (proxy_set_header, add_header, more_set_headers, allow /
  deny, error_page, auth_request_set, limit_req, set_real_ip_from,
  proxy_redirect, valid_referers, mirror, error_log, *_types, ...), and sets
  no proxy_set_header / add_header / access / websocket / proxy_redirect
  lines of its own, so it inherits the location's lists, the included
  entries too (auth_request, headers, access list, Authelia's
  "proxy_redirect http:// $scheme://;"). Everything else
  is repeated, so a guard reading a variable of set_by_lua_block or set-misc
  (set_if_empty, set_unescape_uri, ...) applies to assets as well. A
  proxy_hide_header written in the advanced config is repeated (the asset
  block has its own list); rewrite lines and proxy_hide_header inside an
  included file don't apply to assets (documented)
- a top-level proxy_store (not off) leaves proxy_cache out of the cache block
  like a cache directive of the advanced config: nginx -t rejects both in one
  location ("is incompatible")
- the tokenizer records statement offsets, ends and block ends for that

Docs: assets behave like the location; the `set` limitation and the `map`
advice (map is not allowed in a server block) are removed.

Tests: unit tests for the copy, nested locations and own cache directives;
harness cases for a 403 guard on cached assets (also after a cached hit), a
rewrite, a set inside an if, a nested location block and an access list;
unit and harness cases for includes (Authelia-like proxy.conf with cache
directives and proxy_set_header / add_header, an auth_request snippet with
nested locations, an included guard, set_by_lua_block and set_if_empty
guards next to an include, proxy_store with and without an include, an
included proxy_redirect, valid_referers both included and direct).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
4d309a369f fix(review): keep cached assets of a variable proxy_pass on the location's upstream
With Cache Assets enabled the host's server block includes the host-level
asset regex (conf.d/include/assets.conf, proxied to the main upstream) before
the custom locations. Without a nested asset location that regex wins over a
prefix location, so a forward path such as /api/$arg_id sent
/api/app.css?id=5 to the main upstream with the original URI instead of
/api/5 (the same for a variable forward host).

Every prefix/regex location with Cache Assets gets the nested asset location
again. For a variable forward host or path it repeats the parent's proxy_pass
as it is (no rewrite, proxy_redirect off like the parent), and every nested
asset location now repeats the top-level `set` statements of the advanced
config (read with lib/nginx-tokenize.js), so /v1/$target with
`set $target t;` still reaches /v1/t. The nested regex group is
non-capturing, so $1 of the parent is kept. A `set` inside an `if` or other
block is not repeated (documented).

test/nginx-semantics renders the cached cases with the full host template
(proxy_host.conf, :8012/:8013) against a main upstream on echo:9001 and
flags any response from it unless expected; new cases /api/ ->
/api/$arg_id, $backend with and without a forward path. With the previous
renderer the harness reports 9 differences, now 0. A regex location's
assets still go to the main upstream (the host-level regex comes first), as
on develop; documented and covered by /cachere/app.css.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
718f79ec3f fix(review): no nested asset location for a variable forward path
With Cache Assets enabled, a forward path such as /v1/$target could read a
variable set by `set $target ...;` in the location's advanced config. The
nested asset location used that path but never ran the parent's `set`, so
asset requests went to /v1/ instead of the intended URI.

A forward path with any nginx variable now gets no nested asset location
(like a variable forward host): its assets go through the parent's
proxy_pass, uncached. Adds unit tests and a nginx-semantics case
(/cvt/, caching + set $semtarget + /v1/$semtarget).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
c7c2551086 fix(review): regenerate locations when the dynamic DNS setting changed
Restarting with NPM_LOCATION_DYNAMIC_DNS=false (or without a resolver) did
not bring back literal upstreams for healthy proxy hosts: their configs
already had the current version marker, so the startup reconcile skipped
them. The config of a proxy host with custom locations now records the
setting it was rendered for (`# npm-location-dns: dynamic|static`) and the
reconcile regenerates it when that differs from the current setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
07917e1893 fix(review): quarantine a location behind an error without a line
Problem: a custom location with `proxy_set_header X-Test $missing_variable;`
still blocked the whole host save. nginx reports `unknown "missing_variable"
variable` without file or line (variables are checked after parsing), so the
error never reached the per-location quarantine, which needs a line inside a
location's markers. The check without this host passed, so the save was
rejected as a "conflict with another host"; in bulk mode (startup, repair of
another host) the whole host went offline instead of the one location.

Fix: lib/nginx-locations.js gets isolateFaultyLocations(). When an error has
no line and only this host's config causes it (no file named and the test
without the host passes, or the host's file named without a line),
configureHost() stubs the rendered locations: if the error stays with all of
them stubbed it comes from the host itself and the result is unchanged.
Otherwise each location is rendered alone with all the others still stubbed,
and every one that brings the same error back is quarantined. Two broken
locations with the same message are thus both found, and a working location
is never quarantined for them (stubbing one at a time would leave the other's
identical error and blame every candidate). Only when none fails alone (they
fail only together) is each one stubbed alone and the first that makes the
error go away (or change) quarantined, all of them when none does. The loop
then tests the full config again, bounded by maxQuarantines as before. In a
nested configure it is skipped when the host being saved is the cause
(causedByProtected() handles that as before). After the search the config
that failed is written back to the host's file, so a host rejected at host
level in bulk mode keeps its real config as .err for inspection, not the last
stubbed variant.

When no location is to blame (the error stays with all of them stubbed,
or the host has none), the host level check from the feat(nginx) commit
applies as before: the host is only rejected as a conflict with another
host when the error goes away with every other host's config moved aside
(failsAlone()), otherwise it fails with a host level error such as
`Advanced configuration: unknown variable "$x"`.

Tests: nginx-location-isolate.test.js with unit tests for the search and
configureHost() against a fake nginx -t that reports unknown variables
without a line: the bad location is quarantined (503 stub) and the host
stays online; two bad locations with different variables are both
quarantined; two bad locations with the same variable around a clean one
quarantine only the two, the clean one stays ok; the same variable in the
host's advanced config still rejects the host at host level with an
"Advanced configuration" message (not a conflict with another host), also
for a host without locations, and in bulk mode its .err file holds the
real config (proxy_pass, the variable), not 503 stubs, and its nginx_err
names the advanced configuration.

Cypress (ProxyHostLocations): a location with `$missing_variable` is
quarantined with an unknown-variable message, the host stays online, its
other location serves and the bad one answers 503.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
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
Tom Winnerl
7581f54320 fix(review): keep forward paths with nginx variables literal
Problem: a forward path that contains an nginx variable (`/api/$arg_id`,
`/api/${arg_id}/x`, `$request_uri`) was rendered like any other forward path
in dynamic mode: `rewrite "^/a/(.*)$" /api/$arg_id$1 break;` plus a proxy_pass
without URI. nginx sends a variable-containing proxy_pass URI as it is, so
before this branch `/a/foo?id=42` reached the upstream as `/api/42`. With the
rewrite it reached `/api/42foo?id=42`: the rest of the path was appended,
the query string kept, `$request_uri` re-escaped. The nested asset location
used the same rewrite in both modes, so cached assets went to the wrong URI
even for static locations.

Fix: chooseLocationMode() renders a location whose forward path contains a
`$` static, i.e. literally as before (`proxy_pass http://app:80/api/$arg_id;`).
A proxy_pass with variables is resolved by nginx per request anyway, so an
unknown host still doesn't fail `nginx -t`; a host that doesn't resolve keeps
the "unresolved" status. rewritesUri() is false for these paths, the nested
asset location gets the forward path as its proxy_pass URI and
`proxy_redirect off` (like its parent, "proxy_redirect default" is not
possible with variables), and it is not added when the forward path uses a
regex capture ($1), which the nested regex location would overwrite.

Tests: unit tests for the mode choice and the rendering (main and asset
location); nginx-semantics cases /av/, /avb/, /avh/, /avr/ and the cached
/avc/, with a new expected-response column in reqs.txt (static, dynamic and
the old literal rendering must all answer `/api/42`). Against the previous
renderer the harness reports 11 diffs, now DIFFS=0.

Cypress (ProxyHostLocations): `/q/` with forward path `/$arg_page` is
static and `/q/anything?page=dashboard` serves examplesite's /dashboard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
e4b7b806e7 docs: custom location modes and statuses
The "Host Status and Nginx Errors" page becomes "Custom Locations": how a
location reaches its upstream (dynamic / static), the location statuses, and
the location parts of errors, the API meta and startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 09:03:56 +01:00
Tom Winnerl
5aced8f6d0 fix(review): reject log paths that start with a request variable
`access_log $http_x;` (also `${http_x}`, `"$arg_f"`, `$cookie_c combined`, `$host$http_x`) passed the
check: a path starting with a variable returned early. nginx resolves such a path below /etc/nginx/nginx/,
so a header `X: ../../../data/nginx/proxy_host/2.conf` appended log lines to another host's config.

- A path that starts with any variable but the few that can't hold `/` or `..` is rejected; one that starts
  with such a variable ($host.log) is checked as a relative path.
- Variables `set` in the same advanced configuration are replaced by each value they are set to, so
  `set $p /data/logs/a.log; access_log $p;` stays allowed and `set $p $http_x; access_log $p;` is rejected.
  Any other variable (set elsewhere, map, $1, ...) counts as one the client fills in.
- A request variable followed by a `/` (`$http_x.d/foo`) or `..` after any variable is rejected, and
  `.npm-aside` counts as a config suffix (it becomes the .conf at startup).

Verified on nginx-full: every case of the unit tests run with steering headers, args and cookies; no
allowed case changes a .conf/.types/_params/.npm-aside/.conf.err file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 08:23:03 +01:00
Tom Winnerl
3f4f5a81bf fix(review): show hosts offline that the startup check disabled without a reconcile
With NPM_RECONCILE_ON_START=false nothing updated the stored status of a
host whose config prepare/55-nginx-validate.sh moved to .err, so it kept
showing online. A mark-only pass now runs instead of the reconcile: such
hosts are offline (reason rejected_at_startup, with a hint to save the host
again), without regenerating or reloading. The startup log line and the
docs of the variable say how to bring them back. New keys in en/de/et/vi.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 06:12:49 +01:00
Tom Winnerl
e7c6d07a79 i18n(nginx): translatable host-level config error text
The host status popover, the save warning, the modal error and the error
toasts showed the backend's English message (nginx_err / error.message)
in every language, e.g. 'Advanced configuration: unknown directive
"proxy_passs" (line 3).', 'Nginx rejected Proxy Host #3: ...',
'Disabled automatically: ...' and the hints.

Backend: NginxConfigError.details (and so meta.nginx_details) now also
say what the UI words the message from: `area` + `relative_line` (where
in the host's config, host_advanced), `reason` for the special cases
(conflict, regenerated_conflict, too_many_broken_hosts with `max`,
redacted), `detail` (the humanised nginx error on its own), `hint_code`
(the rule of the hint), `auto_disabled` in the meta of a host taken
offline while another host was saved, `context: "default_site"`. An
unsafe_value offline meta names the value in `field` (eg. forward_host,
from unsafeValueError()'s new optional argument) and carries the value
itself, quoted, as `detail`. The English
message stays as it was for API users and logs. Schema, docs and unit
tests cover the new fields.

Frontend: describeNginxError() words the error from these details in the
UI language (nginx-error.*, en/de/et/vi), nginx's error is shown below
it untranslated, the hint comes from nginx-error.hint.<code>. Used by
the host status popover, SaveWarning, NginxErrorMessage and
formatApiError() (one line for toasts). Details stored by an older
version keep showing the backend's message. An unsafe value is shown
after the name of its field (the form's label where one exists,
nginx-error.field.* otherwise).

The status badge of a disabled host uses the existing `disabled` text,
which more languages translate, instead of a new host-status.disabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 00:10:05 +01:00
Tom Winnerl
1fff746060 docs: host status, nginx errors and startup protection
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:48:58 +01:00
Jamie Curnow
47c9bfba4f Update dependencies 2026-11-09 11:55:20 +10:00
Jamie Curnow
f915ca2462 Update all deps, and cypress 2026-11-04 20:54:23 +10:00
dependabot[bot]
2cd346d054
Bump postcss from 8.5.14 to 8.5.25 in /docs
Bumps [postcss](https://github.com/postcss/postcss) from 8.5.14 to 8.5.25.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.5.14...8.5.25)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.25
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-02 06:13:35 +00:00
Jamie Curnow
a62c2a6dc3 Adds support for custom admin port via env var #3808
and documentation
2026-06-10 11:24:53 +10:00
Jamie Curnow
553a69a9ef Adds Certbot document to docs site 2026-05-27 07:54:23 +10:00
jc21
ba2f714b55
Merge branch 'develop' into docs/add-selfhostingsh-guide 2026-05-14 14:03:27 +10:00
jc21
cd32dbdc4d
Merge pull request #5403 from Mark0025/docs/add-npm-auth-gateway
docs: add NPM Auth Gateway to third-party integrations
2026-05-14 13:54:24 +10:00
jc21
2a6d0d8b32
Merge pull request #5417 from fankes/develop
Docs: Fix PostgreSQL volume mapping to prevent data loss
2026-05-14 11:42:46 +10:00
dependabot[bot]
e49af3cc87
Bump postcss from 8.4.47 to 8.5.14 in /docs
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.47 to 8.5.14.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.47...8.5.14)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-13 04:12:48 +00:00
fankesyooni
1b782997ef
fix: postgres data volume path 2026-03-19 11:10:24 +08:00
Terry Git Cracken
9e4c92a066 docs: add NPM Auth Gateway to third-party integrations
Add NPM Auth Gateway — a companion app that adds user-level access
control with auto IP whitelisting on top of NPM's access list system.

NPM remains authoritative. The gateway only reads/writes through
NPM's REST API. If the gateway goes down, all existing IP whitelists
persist in NPM.

Running in production managing 90+ proxy hosts.
2026-03-14 20:08:49 -05:00
Nishant
4a9ad2baf7 docs: add selfhosting.sh guide to third-party list 2026-03-06 19:37:51 +05:30
dependabot[bot]
d49cab1c0e
Bump rollup from 4.24.0 to 4.59.0 in /docs
Bumps [rollup](https://github.com/rollup/rollup) from 4.24.0 to 4.59.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.24.0...v4.59.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-version: 4.59.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-26 11:05:43 +00:00
Jamie Curnow
67d40e186f Attempt to fix #5335 by allowing resovler generation to be opt-out with a env var 2026-02-26 08:32:02 +10:00
Jamie Curnow
51ef7f3b86 Docs update, use package version instead of latest, refer to better mariadb image 2026-02-19 08:36:41 +10:00
Jamie Curnow
5f5a3870e4 Drop support for armv7 builds, bump version, update docs 2026-02-17 12:55:56 +10:00
Jamie Curnow
43bc2a743e Add note to docs about retiring armv7 after June 2026 2026-02-17 11:38:17 +10:00
Jamie Curnow
462c134751 2fa work slight refactor
- use existing access mechanisms for validation
- adds swagger/schema and validation of incoming payload
2026-01-14 11:45:12 +10:00
dependabot[bot]
2a3978ae3f
Bump mdast-util-to-hast from 13.2.0 to 13.2.1 in /docs
Bumps [mdast-util-to-hast](https://github.com/syntax-tree/mdast-util-to-hast) from 13.2.0 to 13.2.1.
- [Release notes](https://github.com/syntax-tree/mdast-util-to-hast/releases)
- [Commits](https://github.com/syntax-tree/mdast-util-to-hast/compare/13.2.0...13.2.1)

---
updated-dependencies:
- dependency-name: mdast-util-to-hast
  dependency-version: 13.2.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-13 13:28:52 +00:00
piotrfx
427afa55b4 Add TOTP-based two-factor authentication
- Add 2FA setup, enable, disable, and backup code management
- Integrate 2FA challenge flow into login process
- Add frontend modal for 2FA configuration
- Support backup codes for account recovery
2025-12-28 11:58:30 +01:00
Jamie Curnow
2b3e9d72f4
Updated docs screenshots 2025-11-04 13:05:21 +10:00
Jonathon Aroutsidis
e34206b526 Include SSL Options for MySQL 2025-11-03 10:46:20 +11:00
jc21
bc2867b357
Merge pull request #4803 from NginxProxyManager/dependabot/npm_and_yarn/docs/vite-5.4.21
Bump vite from 5.4.19 to 5.4.21 in /docs
2025-11-03 08:18:00 +10:00
jc21
52093ba258
Merge pull request #4805 from vlauciani/patch-1
Update PostgreSQL volume path in setup documentation for 18+
2025-11-03 08:15:23 +10:00
Jamie Curnow
1a117a267c
Fix to postgres 17 2025-10-27 08:13:03 +10:00
Valentino Lauciani
bfcd057755
Update PostgreSQL volume path in setup documentation for 18+ 2025-10-24 09:30:19 +02:00
dependabot[bot]
08bdc23131
Bump vite from 5.4.19 to 5.4.21 in /docs
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.19 to 5.4.21.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.21/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.21/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 5.4.21
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-21 07:13:05 +00:00
Jamie Curnow
e6f7ae3fba
Move from docker-compose to docker compose 2025-10-14 07:54:25 +10:00
Jamie Curnow
0b2fa826e0
Introducing the Setup Wizard for creating the first user
- no longer setup a default
- still able to do that with env vars however
2025-10-02 08:12:05 +10:00
jc21
d98f4b43dc
Merge pull request #4398 from cg-zhou/feature/add-ip-ranges-env-var
Added IP_RANGES_FETCH_ENABLED environment variable
2025-06-30 14:54:40 +10:00