Hi. Following official docs at basicauth (Caddyfile directive) β Caddy Documentation, I tried to setup basic auth but run into the issue, that the directive seems to be different and results this way in an error.
1. Caddy version (caddy version
):
v2.1.1
2. How I run Caddy:
via docker-compose
caddy:
image: caddy:2.1.1-alpine
ports:
- 80:80
- 443:443
volumes:
....
a. System environment:
Docker, alpine
b. Command:
c. Service/unit/compose file:
d. My complete Caddyfile or JSON config:
basicauth /secret/* {
Bob JDJhJDEwJEVCNmdaNEg2Ti5iejRMYkF3MFZhZ3VtV3E1SzBWZEZ5Q3VWc0tzOEJwZE9TaFlZdEVkZDhX
}
my.test-domain.io {
{
root * /usr/share/my-app
file_server
}
3. The problem Iβm having:
Starting caddy results in the following error:
caddy_1 | {"level":"info","ts":1632204348.0622334,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
caddy_1 | run: adapting config using caddyfile: /etc/caddy/Caddyfile:6: unrecognized directive: Bob
Error: unrecognized directive: Bob
4. Error messages and/or full log output:
unrecognized directive: Bob
5. What I already tried:
other passwords