HTTPS on ECS with docker, Let's Encrypt with no http server

One thing that you can check is whether your ECS service is set up with an ELB/ALB already. If you used the AWS console’s wizard UI to create the service it’s possible you already have one without even realizing since I think it creates them automatically. If you have a load balancer this could be the issue since the load balancer terminates the SSL connection for you already, so it would never reach your Phoenix app as HTTPS.

You should also check the port mappings in your task definition. It could be that you didn’t map the ports correctly there. You’d need to map both 80 and 443 to your Docker host’s expected ports.

Another thing that could be helpful is to turn logging on to :info and then turn on Cloudwatch logging from ECS momentarily and see if you get any useful output. It sounds to me like the HTTPS connection never hits your Phoenix app at all, so that should help you narrow the debugging focus to infrastructure misconfiguration.

Also, really if you’re doing HTTPS on ECS, I highly recommend using an ALB with ACM since it does all of this hard work for you without having to manually manage any certs. If it’s helpful I gave a talk on this exact setup two years ago and there’s a full code repo with Terraform config scripts you can use to bootstrap an infrastructure like this: https://m.youtube.com/watch?v=JtUy68PeEWE&t=1020s