1. The problem I’m having:
caddy validate fails with unrecognized global option: trusted_proxies even on a minimal Caddyfile.
- Minimal Caddyfile that Fails:
{
trusted_proxies {
source cloudflare
}
}
http://localhost:8080 {
respond “Test OK”
}
2. Error messages and/or full log output:
Error: adapting config using caddyfile: /etc/caddy/Caddyfile:2: unrecognized global option: trusted_proxies
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
3. Caddy version:
Caddy Version: v2.9.1
4. How I installed and ran Caddy:
apt get install
a. System environment:
Ubuntu 20.04 LTS
b. Command:
caddy validate --config /etc/caddy/Caddyfile2025/04/11 23:28:18.502 INFO using config from file {"file": "/etc/caddy/Caddyfile"}
Error: adapting config using caddyfile: /etc/caddy/Caddyfile:2: unrecognized global option: trusted_proxies
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
c. Service/unit/compose file:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
d. My complete Caddy config:
{
trusted_proxies {
source cloudflare
}
}
http://localhost:8080 {
respond "Test OK"
}
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.