So, this is not actually a valid version of Caddy, it was a mistaken release. See this comment:
Please run apt install caddy=2.2.1
to re-install the latest stable version.
As for your vars
handler, it should just be this:
{
"handler": "vars",
"root": "/var/www/localhost/asset_root"
}
You can see in the root
handler’s docs that the rest of the keys are the variable names to set, with the appropriate value.
If it’s your first time using Caddy, I recommend starting from a Caddyfile instead, then using the caddy adapt
command to get the underlying JSON config.
Your JSON config is basically just this in Caddyfile:
:8080 {
root * /var/www/localhost/asset_root
file_server
}
Then you can run caddy adapt --pretty
to get the JSON config.