New /api/upstreams endpoints that help picking and watching forward hosts:
- GET /upstreams/candidates suggests upstreams from three sources: hosts
already used by other proxy hosts/streams, containers found through
Docker's embedded DNS on the networks NPM is attached to
(NPM_DNS_DISCOVERY, on by default) and, opt-in, containers from the
Docker API (NPM_DOCKER_DISCOVERY + DOCKER_HOST, e.g. a docker-socket-proxy).
- POST /upstreams/check resolves a host with the same resolver nginx uses
and opens a TCP connection to the port, returning a status code
(ok, dns_not_found, tcp_refused, ...) and the round trip time. Checks
are rate limited per user and can be turned off with NPM_UPSTREAM_CHECK=false.
- GET /upstreams/health returns the results of a background monitor that
checks the targets of all enabled hosts every NPM_UPSTREAM_HEALTH_INTERVAL
seconds (default 60, 0 turns it off). It shows the hosts the proxy host
and stream lists show the user (with proxy hosts shared through
permissions.meta.proxy_host_ids). The monitor starts with the backend
and stops on SIGTERM.
Access is controlled by the new upstreams:discover permission (users who may
manage proxy hosts or streams); access.can() gets a quiet option so this
lookup doesn't log a denial for every request. The OpenAPI schema
documents the three paths and their result objects.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>