1. Caddy version (caddy version
):
v2.5.2 h1:eCJdLyEyAGzuQTa5Mh3gETnYWDClo1LjtQm2q9RNZrs=
2. How I run Caddy:
caddy reload
with Caddyfile
a. System environment:
Linux 5.4.0-109-generic #123-Ubuntu x86_64
b. Command:
caddy reload
c. Service/unit/compose file:
-
d. My complete Caddyfile or JSON config:
john.abc.com {
# Enable the static file server.
file_server {
root /var/www/html/john
}
}
3. The problem I’m having:
Currently I add the above config manually every time there is a new user.
How to make it dynamically so userX accessing userX.abc.com will get static file server in /var/www/html/userX ?
4. Error messages and/or full log output:
No error message but it didn’t work. I can’t access the site.
5. What I already tried:
*.abc.com {
# Enable the static file server.
file_server {
root /var/www/html/{http.request.host.labels.2}
}
}