The Proxies (nginx / everything that forwards)
Every "door" that moves a request from you to a service, and how each one is built. Verified live 2026-11-29 (NPM config files read from the NAS, UDM port forwards via API, curl probes). Two proxy systems, one raw nginx, plus the non-nginx proxies (Lancache).
The two ways to reach a service — and which is which
LAN (any device on WiFi/LAN): talk to the IP directly.
http://192.168.1.70:8123 (HA), http://192.168.1.70:2283 (Immich),
http://192.168.1.70/ (this docs site), http://192.168.1.5 (AdGuard UI port
aside, DNS is .5:53).
Off-LAN (phone outside the house): the only doors are
(a) the UDM Pro WAN (cable modem → UDM, public IP, port-forwards listed
below) and (b) Tailscale (tailnet overlay, 100.x addresses). The DNS name
*.lootgoblin.duckdns.org = the public IP (209.173.188.33 at check time,
dynamic — the duckdns chart is STOPPED; the name currently resolves only
because it was updated earlier; if it ever stops resolving, that's why).
OUTSIDE (public IP 209.173.188.33)
│ :443/tcp :80/tcp
▼
UDM Pro (WAN=192.168.68.61 on Deco, LAN=.1)
│ :443 → 192.168.1.70:30443 (NPM-HTTPS)
│ :80 → 192.168.1.70:30080 (HTTP)
▼
NPM = openresty (ngx) inside ix-nginx-proxy-manager-npm-1
┌────────────────────────────────────────────────────────────┐
│ SNI / Host: stoat.lootgoblin.duckdns.org → caddy:80 │
│ SNI / Host: lootgoblin.duckdns.org → 192.168.1.171:7000 │
│ SNI / Host: mealie.lootgoblin.duckdns.org→ 192.168.1.70:30111 │ ❌
│ SNI / Host: ntfy.lootgoblin.duckdns.org → 192.168.1.70:8091 │ ❌
│ (host 7 = ntfy, host 1 = odysseus, 3 = mealie, 9 = stoat) │
└────────────────────────────────────────────────────────────┘
The NPM proxy, in detail
What it is: the nginx-proxy-manager chart on the NAS. Its container
(ix-nginx-proxy-manager-npm-1) runs openresty (nginx + Lua). You manage
it through the NPM web UI at http://192.168.1.70:30080 (LAN) — the UI is one
sidecar, and nginx loads one .conf per proxy host from
/data/nginx/proxy_host/N.conf inside the container (bind-mounted on the
host at /mnt/.ix-apps/app_mounts/nginx-proxy-manager/data/nginx/proxy_host/).
The host port story. NPM publishes three ports on the NAS:
- :30080 — NPM admin UI (and the UDM forward of :80 lands here).
- :30443 — the TLS proxy door (the UDM forward of :443 lands here).
- :80 inside → also listens, but the UDM :80 forward goes to 30080, so the
public-:80 traffic is the NPM UI, not the app door.
App traffic off-LAN: public :443 → UDM → 192.168.1.70:30443 → NPM.
How one proxy host conf works (anatomy, from 9.conf = stoat):
- set $server "caddy"; set $port 80; — the backend. Either a docker
service name resolvable from the NPM container, or an IP:port.
- listen 443 ssl + ssl_certificate /etc/letsencrypt/live/npm-8/... —
each host has its own Let's Encrypt cert (the ACME challenge is answered on
:80 via the letsencrypt-acme-challenge.conf include).
- server_name stoat.lootgoblin.duckdns.org + http2 on — this is why the
right domain gets the right backend on the same 30443 port.
- location / { proxy_set_header Upgrade…; include proxy.conf } — WebSocket +
long-poll support on every host (needed for chat, LiveKit, and any WS
app).
- Per-host tuning (stoat only, because Stoat uploads big files):
client_max_body_size 500M; proxy_request_buffering off; and 900s timeouts
on send/read.
- access_log /data/logs/proxy-host-9_access.log proxy — live per-host
logs (host 9 = stoat etc.), under /data/logs in the container.
Critical container-network fact (learned the hard way 2026-11-28): the NPM
container can reach backends by docker service name (it's attached to the
stoat_default network, so caddy resolves) and by other machines' IPs
(192.168.1.171:7000 works), but it cannot reach the NAS host's own
LAN IP (192.168.1.70:30111 and :8091 time out from inside the
container, even though the host itself and the box reach both fine). So any
proxy host pointing at 192.168.1.70:<port> is currently dead.
The full host list (live, 2026-11-29)
| # | Domain | Backend (in conf) | Purpose | Status |
|---|---|---|---|---|
| 1 | lootgoblin.duckdns.org |
192.168.1.171:7000 |
Odysseus (box) — 302 to login | ✅ |
| 3 | mealie.lootgoblin.duckdns.org |
192.168.1.70:30111 |
Mealie recipes | ❌ host-IP trap |
| 7 | ntfy.lootgoblin.duckdns.org |
192.168.1.70:8091 |
push notifications | ❌ host-IP trap (http→https 301 works) |
| 9 | stoat.lootgoblin.duckdns.org |
caddy:80 (docker DNS) |
Stoat chat — the bot's home | ✅ verified /api/ → 200 |
The fix for hosts 3 & 7 (either one):
1. Preferred: attach NPM to each app's docker network and retarget the conf
to the service name (e.g. docker network connect mealie_default
ix-nginx-proxy-manager-npm-1, then set server mealie port 9001 —
confirm exact service name/ports in the app's compose), matching how stoat
works via caddy:80.
2. Or: change the two confs' $port targets to a path the container can
reach (the host's docker bridge IP, or publish the app ports and use the
host IP only if the hairpin is fixed).
After any conf edit: docker exec -u npm ix-nginx-proxy-manager-npm-1 nginx -s
reload — as the npm user, not root: as root it fails with
kill(224,1) … Operation not permitted (s6 owns PID 1) and can masquerade as
"a reload that applied". Back up the conf (.bak-<date>) before editing —
9.conf.bak-20261128 (the dead 192.168.1.70:8880 target) is the model.
The raw nginx (famdocs) — how this site is served
Not NPM at all. A plain docker container named famdocs
(nginx:alpine, --network host) running nginx with the site bind-mounted
from /mnt/Das array 2/family-docs and its config from
/mnt/Das array 2/famdocs-nginx/nginx.conf:
# the whole config that matters
server {
listen 80;
root /usr/share/nginx/html;
location / { try_files $uri/ $uri $uri.html /404.html; }
}
Why each piece exists:
- --network host + listen 80 → it grabs :80 on 192.168.1.70
directly. That's why http://192.168.1.70/ is the docs home.
- try_files $uri/ $uri $uri.html /404.html — the $uri/ clause is
load-bearing: without it, any request for a directory (including /)
falls to /404.html and the home page never shows.
- It's a static bind-mount: rebuild = regenerate files in
/mnt/Das array 2/family-docs (the rebuild_docs_site.py pipeline does this
via the TrueNAS API) — no container restart needed unless the mount or
config changes.
- Owner-only access convention: it listens on LAN only; nothing forwards it to
the WAN, and Tailscale serving is a deliberate add-later (one tailscale
serve command on the box), not yet done.
The non-nginx proxies (so the picture is complete)
| Proxy | Where | What it moves |
|---|---|---|
| Lancache (monolithic) | .71:80 (HTTP), .71:443 (SNI), WAN :3128 |
internet file cache for game CDNs + the family-side proxy; 3128 → 192.168.1.71:80 is a UDM forward so the .68 LAN can use it with bypass 192.168.0.0/16 |
| Lancache DNS | .72:53 |
the DHCP-primary DNS for the house (fast answers for cached domains), chained with AdGuard elsewhere |
| AdGuard Home | .5:53 |
house DNS filtering; WAN-upstream DNS for the UDM |
| Caddy (stoat chart) | caddy:80 inside stoat_default |
TLS + static-web + media inside Stoat; NPM terminates TLS ahead of it, so caddy is purely the in-network hop |
| UDM Pro | WAN | cable-modem-side NAT gateway: 4 port forwards today (25565 Minecraft → 192.168.1.171, 443 → NPM 30443, 80 → NPM 30080, 3128 → Lancache .71:80) |
If a proxied thing "doesn't work", in this order
- Which door? LAN (direct IP)? Public (duckdns)? Or LAN-but-through-NPM?
- Public 443 →
curl -sk -m 20 https://<host>/from the box (the box is double-NATed but its public path is the clean test). 200 = NPM+backend fine. - 502/504 or HTML-instead-of-JSON → the NPM→backend leg. Check
/data/logs/proxy-host-N_error.log(host number = the conf number). - 000/timeout on a host pointing at
192.168.1.70:*→ the host-IP trap; the backend is alive (prove by reaching the same port from the box) — retarget the conf to a docker service name. - WS-specific 502 with a healthy app → the client negotiated HTTP/2;
openresty answers Upgrade-on-HTTP/2 with 502. Force
--http1.1in probes (real browsers handle it). - After any conf edit,
nginx -s reloadasnpmand re-verify — a root reload silently no-ops.
Created 2026-11-29 from the live NPM confs (proxy_host/{1,3,7,9}.conf), the
famdocs nginx.conf, UDM list/portforward, and curl probes from the box and
from inside the NPM container. Numbers/ports are from that day's check; the
structure (which container does what) is stable.