Load caddyflie error

caddy version is 2.7.0
my Caddyfile is
http://127.0.0.1:8001 {
root * /Users/go/caddy/file/
file_server
}
When I start using this file, it can run

but
curl -X POST localhost:2019/load -H “Content-Type: text/caddyfile” -d @Caddyfile

promt:
{“error”:“adapting config using caddyfile adapter: Caddyfile:1 - Syntax error: Unexpected token ‘file_server}’, expecting ‘}’, import chain: [‘’]”}

Please upgrade to latest.

The file might be malformed. Are you sure you’ve copied the file content as-is into here? Run caddy fmt in the directory and/or caddy validate.

1 Like

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