315 shaares
Generate password using caddy hash-password:
caddy hash-password
Add to Caddy File a basic-auth snippet with the obtained hash:
(basic-auth) {
basicauth /* {
bob $2a$14$0Lh5......RfjeG
}
}
Import to Caddy File the snippet where needed in site block:
example.com {
import basic-auth
root * /site
file_server browse
}