1. The problem I’m having:
I have a domain hosting platform that has hundreds of domains. When renewing SSL certificates sometimes I get “too many failed authorizations recently” error message from let’s encrypt.
2. Error messages and/or full log output:
{
"level": "error",
"ts": 1690368347.5156703,
"logger": "tls.obtain",
"msg": "could not get certificate from issuer",
"identifier": "www.#####.###",
"issuer": "acme-v02.api.letsencrypt.org-directory",
"error": "HTTP 429 urn:ietf:params:acme:error:rateLimited - Error creating new order :: too many failed authorizations recently: see https://letsencrypt.org/docs/failed-validation-limit/"
}
3. Caddy version:
2.4.5
4. How I installed and ran Caddy:
a. System environment:
AWS Fargate, Linux, ECS
b. Command:
It's a Fargate container so I don't need to run any command. I just have provided my docker image made out of caddy:2.4.5
c. Service/unit/compose file:
local Dockerfile, using that I build my dcoker image
FROM caddy:2.4.5
COPY Caddyfile /etc/caddy/Caddyfile
ENV SslValidation ${SslValidation}
ENV ViewerEndpoint ${ViewerEndpoint}
ENV SitemapEndpoint ${SitemapEndpoint}
ENV DashboardEndpoint ${DashboardEndpoint}
EXPOSE 80
EXPOSE 443
d. My complete Caddy config:
{
on_demand_tls {
ask {env.SslValidation}
}
}
:443 {
header Server "Server_name"
header -x-powered-by
@trailing_slash {
path_regexp no_slash (.+)\/$
}
@domain {
header_regexp domain host ^www\.(.+)$
}
redir @domain https://{http.regexp.domain.1}{uri}
redir @trailing_slash {re.no_slash.1} 308
tls {
on_demand
}
handle_path /dashboard {
reverse_proxy {env.DashboardEndpoint}
}
handle_path /dashboard/* {
reverse_proxy {env.DashboardEndpoint}
}
reverse_proxy {env.ViewerEndpoint}
}