This looks like a bug to me, but wanted to make sure I wasn’t missing something.
If I don’t use the -config param, the caddyfile is used and there is no problem, but if I use the -config param, Caddy complains about the first character in the file, a “w”, and drops out.
4. Error messages and/or full log output:
INFO using provided configuration {“config_file”: “caddyfile”, “config_adapter”: “”}
run: loading initial config: decoding request body: invalid character ‘w’ looking for beginning of value
5. What I already tried:
Quote symbols around the filename don’t change anything.
Are you sure the file is named caddyfile, or is it Caddyfile? It should be Caddyfile.
I think what’s going on is Caddy will only assume the adapter to be caddyfile is the filename begins with Caddyfile (case sensitive). Otherwise, it assumes it’s a JSON config. So it reads the first character, sees it’s not a valid JSON character, and quits.
So you’d need to use the --adapter caddyfile flag to tell it “this is a Caddyfile, actually” and make it not assume it’s JSON. Or just make sure your file is named Caddyfile with an uppercase C.