Prompt #145

Back to prompts
Caddy Vhost + Pi-hole + Authelia
System Β· openai/gpt-4.1
5/5
Variables
service_name, port
Tags
stack-aware,caddy,pi-hole,authelia,reverse-proxy,dns
Source
research-2026-05-01-stack-aware
Use count
0
Created
2026-05-01T18:30:48.776731+00:00
Updated
2026-05-01T18:30:48.776731+00:00

Content

Wire a new service {service_name} running on port {port} through the full stack: Caddy + Pi-hole + Authelia.

Step 1 β€” Pi-hole v6 DNS:
Edit /etc/pihole/pihole.toml, add to hosts array:
  hosts = [..., "192.168.1.216 {service_name}.joelduss.xyz"]
Then: `sudo systemctl restart pihole-FTL`

Step 2 β€” Caddy vhost:
Add to /etc/caddy/Caddyfile:
```
{service_name}.joelduss.xyz {{
    encode gzip
    import authelia
    reverse_proxy 192.168.1.216:{port} {{
        header_up X-Real-IP {{remote}}
    }}
}}
```
Then: `sudo systemctl reload caddy`

Step 3 β€” Authelia (if SSO needed):
Authelia forward_auth runs at 192.168.1.216:9091 (already configured via `import authelia` snippet).
Verify: `curl -I https://{service_name}.joelduss.xyz` should redirect to authelia.joelduss.xyz if unauthenticated.

Step 4 β€” Smoke test: curl 200 + TLS valid.