Search code examples
cloudflarecaddycaddyfile

Caddy Server error: "Caddyfile:12 - Error during parsing: Unknown directive 'CLOUDFLARE_API_KEY'"


New to using Caddy server and fighting with the Caddyfile...

This is the current Caddyfile that I have; when I type "caddy" from the command line, from within the same folder, I get the following error:

Caddyfile:12 - Error during parsing: Unknown directive 'CLOUDFLARE_API_KEY'

When I look at the docs here the variable on the page seems to show that I have the syntax correct? confused

Note: I do have the tls.dns.Cloudflare Caddy plugin installed.


Solution

  • Those docs refer to environment variables which are not set in the Caddyfile, they're set externally with your OS, usually through your shell: https://www.cyberciti.biz/faq/set-environment-variable-unix/