1. Caddy version (caddy version
):
v2.4.3
2. How I run Caddy:
a. System environment:
Caddy runs on Docker, in Kubernetes.
b. Command:
APP_BASIC_AUTH_PASSWORD_HASHED=$(caddy hash-password --plaintext $APP_BASIC_AUTH_PASSWORD) caddy run --config /etc/caddy/Caddyfile.json
c. Service/unit/compose file:
ARG CADDY_VERSION=2.4.3
FROM caddy:${CADDY_VERSION}-builder-alpine AS builder
ARG ROUTE53_VERSION=v1.1.2
ARG TLSREDIS_VERSION=0.2.7
RUN xcaddy build \
--with github.com/caddy-dns/route53@${ROUTE53_VERSION} \
--with github.com/gamalan/caddy-tlsredis@${TLSREDIS_VERSION}
FROM caddy:${CADDY_VERSION}-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
RUN apk --no-cache add curl
ENV XDG_DATA_HOME=/data \
XDG_CONFIG_HOME=/config
COPY static/root /
CMD ["scaddy"]
scaddy
is the command outlined above.
d. My complete Caddyfile or JSON config:
The JSON config was too large to place here so I copied it to a Gist - Query matcher example · GitHub
3. The problem I’m having:
An initial config is loaded first. Then the above config is pulled from a remote source. That is when the error message is observed.
4. Error messages and/or full log output:
running dynamically-loaded config failed
loading http app module: provision http: server secure: setting up route handlers: route 5: loading handler modules: position 0: loading module ‘subroute’: provision http.handlers.subroute: setting up subroutes: route 5: loading matcher modules: module name ‘query’: decoding module config: http.matchers.query: json: cannot unmarshal array into Go value of type caddyhttp.MatchQuery
5. What I already tried:
I’ve tried a bunch of different formats, but I can’t get anything to work.
Another problem I’m having is I don’t know if I should include the initial ?
that is found in all query strings in the http.matchers.query
value. The documentation doesn’t provide any clues.