Hello,
1. Version of Caddy I am using (2.7.5
)
2. How I am running Caddy:
I have an Api solution. It is built and deployed onto Amazon ECS via it’s own Dockerfile. In the Dockerfile, I expose port 80. It is working, of course without TLS.
I have another Dockerfile in which I use Caddy builder image to build caddy-dns/route53
module using xcaddy
command. This seems to be working as I am able to get the image running in Amazon ECS. The ECS task has Here is the content of the caddy dockerfile:
# syntax=docker/dockerfile:1
FROM caddy:2.7.5-builder-alpine AS builder
RUN xcaddy build --with github.com/caddy-dns/route53
FROM caddy:2.7.5
COPY Caddyfile /etc/caddy/Caddyfile
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
WORKDIR /etc/caddy
RUN caddy fmt --overwrite
The Caddyfile looks like this:
{
debug
}
simpleauth.ghanavats.com {
tls admin@ghanavats.co.uk {
dns route53
protocols tls1.2 tls1.3
}
reverse_proxy simpleauthentication:80
}
I have reviewed the log I get for the caddy ECS and I saw that it successfully obtained the certificated and downloaded it and everything.
3. Log output:
Below is the last few steps in the log. The log is huge:
{"level":"debug","ts":1700077395.7016873,"logger":"tls.cache","msg":"added certificate to cache","subjects":["simpleauth.ghanavats.com"],"expiration":1707849794,"managed":true,"issuer_key":"acme-v02.api.letsencrypt.org-directory","hash":"5ea0d6fdf2b975f859b7ef35ee40e8a677151812ede32e5f175af105dd2078b6","cache_size":1,"cache_capacity":10000}
{"level":"info","ts":1700077395.5694242,"logger":"tls.obtain","msg":"certificate obtained successfully","identifier":"simpleauth.ghanavats.com"}
Caddy image is running under linux arm64 CPU architecture in Amazon ECS.
4. Problem I am having:
The problem is, although the certificate is obtained, downloaded and cached, when I navigate to my API url via https
I get connection refused error on the browser. I cannot figure out what is the problem.
5. What I’ve already tried:
I have amended the caddy docker file and added
EXPOSE 80
EXPOSE 443
The same issue.
Please help.
Thanks a lot.