Help! unrecognized servers option 'trusted_proxies'

here is my config

{
	servers {
		trusted_proxies static private_ranges
	}
}

:80 {
    root * /srv
    encode gzip
    try_files {path} /index.html
    file_server
}

here is my docker config:

FROM caddy:2-builder AS builder

RUN xcaddy build \
    --with github.com/mholt/caddy-ratelimit

FROM caddy:2-alpine
COPY Caddyfile /etc/caddy/Caddyfile
COPY --from=builder /usr/bin/caddy /usr/bin/caddy

so when i run this config i get this error:
run: adapting config using caddyfile: parsing caddyfile tokens for ‘servers’: /etc/caddy/Caddyfile:5 - Error during parsing: unrecognized servers option ‘trusted_proxies’

What version of Caddy are you using? Make sure you build the latest version, v2.8.4.

1 Like

Thanks, @francislavoie for the reply.
But it was my mistake.
i was using this FROM caddy:2.4.5-alpine as prod in my frontend docker file
but it should be like this FROM caddy:2-alpine as prod

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.