moonmoon.party
← Work log

Home Assistant behind Caddy

Fri Oct 09 2026 20:00:00 GMT-0400 (Eastern Daylight Time)

homeassistant.moonmoon.party was stuck in a redirect loop. Two layers were wrong:

  1. Caddy proxied to :8123, but HAOS Core listens on :80. The :8123 listener only issued 307 redirects to http://…/, which bounced against Caddy’s HTTP→HTTPS redirect.
  2. HA 2026.10 stores HTTP settings in .storage/http after YAML migration. Adding trusted_proxies in configuration.yaml was ignored, so proxied requests returned 400.

Fixes on the lab:

  • Caddy upstream → http://192.168.68.16
  • .storage/http: use_x_forwarded_for + trust 192.168.68.17
  • Set internal_url / external_url to https://homeassistant.moonmoon.party
  • Pointed media/monitor hostnames at Caddy and filled in the Homepage dashboard

LAN-only: those names resolve through Pi-hole to the proxy. Use the clean URL (not a leftover ?auth_callback= link) after onboarding.