Tailnet requests reach caddy as 172.18.0.1: the 443 to 8443 redirect bypasses docker's DNAT #43
Labels
No labels
area/backups
area/ci
area/containers
area/mail
area/minecraft
area/network
area/observability
area/tls
area/tofu
kind
bug
kind
chore
kind
feature
kind
investigation
kind
security
priority
high
priority
low
priority
medium
status/blocked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
hutao/vps#43
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every request over the tailnet reaches caddy from
172.18.0.1, the proxy bridge's gateway, instead of from the client. Follows on from #30, which measured the public ports.Cause
nixos-fw's prerouting chain rewrites tailnet https onto caddy's second listener:redirectis a NAT rule, and netfilter performs NAT for a connection only once. This one runs first (prioritydstnat - 10), so docker's DNAT for published port 8443 never applies. The connection is delivered locally todocker-proxyon :8443, which opens a second connection to caddy using the bridge gateway as its source.Captured on the vps at 2026-10-22 01:14 EEST:
Caddy's access log for mail. and music. shows
"remote_ip":"172.18.0.1","client_ip":"172.18.0.1".Effect
Applies to every tailnet vhost: dozzle, grafana, music, search, syncthing, webmail, and the admin side of git and status.
8e137e9does not record any address for tailnet trafficPublic 443 does not pass through the redirect and is not affected by this issue.
Fix options (none tested)
100.109.115.12:443:8443, tcp and udp) and remove the redirect, so docker's DNAT handles the connection and keeps the source. Unknowns: whether docker accepts this alongside the existing0.0.0.0:443binding, and the tailscale address must exist before caddy starts. Validate locally, not on the vps.docs/src/architecture/access-control.md.Update
docs/src/architecture/access-control.md("Client addresses") in the same branch as the fix.