Problem #
I configured Caddy to do Basic Authentication before reverse proxying to another machine. But the authentication dialog challenge kept popping up in my browser, no matter how many times I’d entered my credentials.
Solution #
Stop Caddy from passing authorization headers, by specifying header-up
with a minus ("-") sign to remove it. You must also remove the Authorization headers from the error handler (handle_errors
). For example:
my.domain.com {
reverse_proxy my.other-domain.com:8001 {
header_up -Authorization
}
basicauth * bcrypt {
my_username my_encrypted_password
}
handle_errors {
header -Authorization
}
}