1. Caddy version (caddy version
):
v2.2.2
2. How I run Caddy:
a. System environment:
Linux Mint 20
b. Command:
caddy run --config ~/test.json
d. My complete Caddyfile or JSON config:
{
"apps": {
"http": {
"servers": {
"server1": {
"listen": [":8080"],
"automatic_https": {
"disable": true
},
"routes": [
{
"match": [
{"host": ["localhost"]}
],
"handle": [
{
"handler": "vars",
"http.vars.root": "/var/www/localhost/asset_root/"
},
{
"handler": "file_server",
"index_names": ["index.html"]
}
]
}
]
}
}
}
}
}
3. The problem I’m having:
According to the docs, the default root path of the file server is {http.vars.root}
. Therefore I’m trying to set this variable so that the fileserver points to the correct location. However, my configuration above doesn’t seem to set the value.
5. What I already tried:
I’ve tried setting the root property of file_server manually and everything works as expected. The problem only occurs when I try to set the {http.vars.root}
variable, which leads me to believe it’s not being set.