infrastructure:caddy-reverse-proxy
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| infrastructure:caddy-reverse-proxy [2026/08/22 06:45] – created - external edit 127.0.0.1 | infrastructure:caddy-reverse-proxy [2026/08/22 12:18] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | # Internal | + | # Caddy Reverse Proxy — Deployed |
| - | Caddy runs on OPNsense (192.168.0.1) providing SSL-terminated reverse proxy for internal LAN services. Auto-TLS via Let's Encrypt DNS challenge (Cloudflare). | + | ## What this is |
| - | ## Access | + | OPNsense Caddy plugin running with `auto_https off` + per-site `tls internal`, serving 6 services on `*.kaburu.lan` over HTTPS using Caddy' |
| - | Local clients with OPNsense DNS can use: | + | ## Architecture |
| - | + | ||
| - | | Service | URL | Backend | | + | |
| - | |---|---|---| | + | |
| - | | Open WebUI | `https:// | + | |
| - | | Portainer | `https:// | + | |
| - | | Ollama API | `https:// | + | |
| - | | Frigate NVR | `https:// | + | |
| - | | Omada Controller | `https:// | + | |
| - | | Home Assistant | `https:// | + | |
| - | + | ||
| - | ## How it works | + | |
| ``` | ``` | ||
| - | Browser → https://openwebui.kaburu.lan | + | LAN device (192.168.0.x) |
| - | | + | ↓ DNS: *.kaburu.lan → 192.168.0.1 |
| - | → Caddy terminates SSL (valid LE cert) | + | |
| - | → Proxies to 192.168.0.253:3000 | + | |
| ``` | ``` | ||
| - | ## DNS | + | No firewall port-forwarding. No WAN exposure. Certs are signed by Caddy' |
| + | |||
| + | ## Services | ||
| + | |||
| + | | Hostname | Backend | Notes | | ||
| + | |----------|---------|-------| | ||
| + | | `openwebui.kaburu.lan` | `http:// | ||
| + | | `portainer.kaburu.lan` | `https:// | ||
| + | | `ollama.kaburu.lan` | `http:// | ||
| + | | `frigate.kaburu.lan` | `http:// | ||
| + | | `omada.kaburu.lan` | `https:// | ||
| + | | `ha.kaburu.lan` | `http:// | ||
| + | |||
| + | ## OPNsense UI configuration (Steve) | ||
| + | |||
| + | Services → Caddy → Domains → Add (per service): | ||
| + | - Domain: `< | ||
| + | - Listen Port: `443` | ||
| + | - TLS: **Use internal CA** (NOT Let's Encrypt) | ||
| + | |||
| + | Services → Caddy → Reverse Proxy → Add (per service): | ||
| + | - Domain: `< | ||
| + | - Directive: `reverse_proxy` | ||
| + | - Upstream: `< | ||
| + | - For HTTPS backends: select `https://` and enable `tls_insecure_skip_verify` | ||
| + | |||
| + | Apply. | ||
| + | |||
| + | ## DNS overrides | ||
| + | |||
| + | Pushed via `scripts/ | ||
| + | - `kaburu.lan → 192.168.0.1` | ||
| + | - `*.kaburu.lan → 192.168.0.1` (one A record per service) | ||
| + | |||
| + | ## Trust Caddy' | ||
| + | |||
| + | Pull the root CA: `scripts/ | ||
| + | Install on each device — see instructions in script output. | ||
| + | |||
| + | ## Verification | ||
| + | |||
| + | ```bash | ||
| + | # From any LAN device with Caddy CA trusted: | ||
| + | curl -v https:// | ||
| + | # Expect: TLS handshake succeeds (no cert warning), 200 OK | ||
| + | ``` | ||
| - | DNSMasq on OPNsense serves `*.kaburu.lan` → 192.168.0.1. Only works for DHCP clients using OPNsense as DNS. Tailscale clients continue to use IPs directly — no change. | + | ## Future: Path B (off-LAN access) |
| - | ## Configuration | + | If you need phone-on-cellular access later, add Cloudflare Tunnel: |
| + | 1. Run `cloudflared` on kaburuaibox or kaburusvr | ||
| + | 2. Each `*.kaburu.casa` → tunnel → Caddy on OPNsense | ||
| + | 3. CF Access enforces email/SSO login | ||
| + | 4. LAN devices stay on `*.kaburu.lan` (cleaner), remote devices use `*.kaburu.casa` + Access auth | ||
| - | Managed via OPNsense web UI: **Services → Caddy Web Server**. | + | See `wiki/ |
| - | - **DNS Provider**: Cloudflare (token in `/ | + | ## Files |
| - | - **Certs**: Auto-TLS via Let's Encrypt DNS challenge | + | |
| - | - **Listen**: All interfaces, port 443 | + | |
| - | - **Backends**: | + | |
| - | ## No impact on | + | - `/ |
| + | - `/ | ||
| + | - `/ | ||
| - | - **Tailscale**: | + | ## Troubleshooting |
| - | - **External sites**: CyberPanel/ | + | |
| - | - **OPNsense firewall rules**: No NAT changes needed | + | |
| + | - **Caddy won't start**: check `sockstat -l | grep caddy` — Caddy needs `caddy.sock` admin socket. Run `service caddy restart`. | ||
| + | - **" | ||
| + | - **Cert warnings in browser**: Caddy' | ||
| + | - **DNS not resolving**: | ||
infrastructure/caddy-reverse-proxy.1787381124.txt.gz · Last modified: by 127.0.0.1
