Ignoring plugins configuration when running caddy validate?

1. The problem I’m having:

I’m setting up some pre-commit action & github action to validate some (embedded in yaml) Caddyfile. We use rate limiting & redis storage backend plugins. To properly validate our configurations, we need to build caddy with the extensions, spin up a Redis/Valkey. That’s a lot to add for not much, so I wish I could ignore the plugins related instructions. Is it possible ?

2. Error messages and/or full log output:

Expected, but I’d like to --ignore-directive “order” or alike

Error: adapting config using caddyfile: parsing caddyfile tokens for ‘order’: rate_limit is not a registered directive, at /dev/stdin:7

3. Caddy version:

v2.11.4 h1:XKxkMTgNSizEvKG6QHue6cAsFOteU2qA61w2tKkCWi0=

4. How I installed and ran Caddy:

xcaddy build --with github.com/mholt/caddy-ratelimit --with github.com/pberkel/caddy-storage-redis

a. System environment:

Ubuntu 26.04.1, Linux framework 7.0.0-31-generic

It’s not possible, and I’d argue adding such feature is a footgun. If you want something like that for yourself, you can abuse env var expansion to inject config lines. It may be tedious, but that’s a compromise for your convenience.

So I ended up building the proper binary for my check. And the maintainer of the Redis storage plugin advices me to use the “caddy adapt”, which effectively check the syntax without pinging the Redis backend. Will do for me, thanks for answering!