V2.4.3: unrecognized directive: ask?

1. Caddy version (caddy version):

v2.4.3

2. How I run Caddy:

via docker container caddy

a. System environment:

docker

d. My complete Caddyfile or JSON config:

on_demand_tls {
	ask http://myhost:8080/checkdomain
}

3. The problem I’m having:

The directive ask seems to be unrecognized, but the documentation clearly states how to use it and there is no indication in the documentation that this feature is not included in v2.

  • How to on-demand TLS with v.2.4.3 ?
  • What other docker image is working for this feature?

4. Error messages and/or full log output:

run: adapting config using caddyfile: /etc/caddy/Caddyfile:9: unrecognized directive: ask

Global options must be wrapped by a set of braces.

See the Caddyfile Concepts page in the docs to see how the Caddyfile is structured.

The reason you got the error you did is because Caddy read on_demand_tls as if it was your site address for a site block (which works fine, Caddy can’t really distinguish that it isn’t a real domain), then tried to read ask as a directive because it was in a “site block”.

2 Likes

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