0

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:3 - Error during parsing: Unknown directive 'if'

When I look at the docs for http.redir here the very last example on the page seems to show that I have the syntax correct? confused

J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94

1 Answers1

2

From the bold text of the docs:

The first line of the Caddyfile is always the address of the site to serve.

Instead, your first line appears to be a directive, redir, which is confusing Caddy.

I would recommend going through the beginner tutorials to learn how the Caddyfile is structured.

Matt
  • 22,721
  • 17
  • 71
  • 112