I am using AWS ECS Fargate and have an application load balancer to forward all the connections to the correct instance.
I did already manage to get up a cluster and a service up and running connected to an ALB which has a DNS record created in Route53. When I head to the subdomain it redirects me to the service instance automatically and it is working fine. It is a Node JS application, so I did set the container to map port 3000, which the application uses.
I tried repeating the same, but this time with a Laravel/PHP application. It has Apache installed in the Docker File. I did manage to setup the service and when I head to the IP of the task, it works fine. However when I try using the subdomain, which has a DNS record tied with the ALB (Application Load Balancer) I get 502 Bad Gateway. I have no clue what is causing the problem!
I have the security group allowing all traffic for the service from the ALB.