Prompt #122

Back to prompts
New Caddy vhost via Pi-hole + Authelia
DevOps Β· claude-3.5-haiku
5/5
Variables
{'name': 'subdomain', 'description': 'e.g. orchestrator'}, {'name': 'port', 'description': 'backend port'}, {'name': 'service_description', 'description': 'what runs there'}
Tags
stack-aware,caddy,pi-hole,authelia,dns
Source
research-2026-05-01-stack-aware-handcrafted
Use count
0
Created
2026-05-01T18:30:35.938632+00:00
Updated
2026-05-01T18:30:35.938632+00:00

Content

Wire `{subdomain}.joelduss.xyz` end-to-end on this stack:

1. Add to `/etc/pihole/pihole.toml` `dns.hosts` array: `"192.168.1.216 {subdomain}.joelduss.xyz"`
   (NOT custom.list β€” that's legacy. Then `systemctl restart pihole-FTL`.)
2. Append to `/etc/caddy/Caddyfile`:
```
{subdomain}.joelduss.xyz {{
    encode gzip
    import authelia    # forward_auth to authelia:9091, omit for public hosts
    reverse_proxy 192.168.1.216:{port} {{
        header_up X-Real-IP {{remote}}
        header_up X-Forwarded-Proto {{scheme}}
    }}
    header {{
        Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
        X-Content-Type-Options "nosniff"
    }}
}}
```
3. `caddy validate --config /etc/caddy/Caddyfile && systemctl reload caddy`
4. Verify: `curl -sI https://{subdomain}.joelduss.xyz/` β†’ 200 (or 302 to authelia for protected)

Service: {service_description}