I tried setting basic auth for everything under the route /reports
where there are some csv files but it simply doesn’t work. The Caddyfile is like the one below:
0.0.0.0:2015
gzip
ext .html
log stdout
root /srv
header / {
Access-Control-Allow-Origin *
Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
Access-Control-Allow-Methods "GET,PUT,POST,DELETE,PATCH,OPTIONS"
}
proxy /api/ prest:3000 {
without /api
}
proxy /backend/ application:6000 {
without /backend
}
proxy /auth/ auth:4000 {
without /auth
}
proxy /publicapi/ publicapi:9000 {
without /publicapi
}
basicauth user password {
realm "csv reports"
/home/www/reports
/home/www/reports/test.txt
}
I’m using Caddy 0.11.0 on a Linux docker conteiner. Besides the syntax above, I tried the alternative one on the documentation: https://caddyserver.com/docs/basicauth
basicauth /reports username password
Is there something wrong on my configuration or it’s a bug on the software?