简体   繁体   中英

AWS ALB (Application Load Balancer) - “502 Bad Gateway” Issue

  • We have using multi-container docker environment for our project to deploy the microservices(Scala) in AWS. We are using AWS ECS (Elastic container service) to deploy and manage the application in AWS Cloud. We have placed 5 microservices within separate Task definition and launched it using ECS.

  • We have setup ALB (Application Load Balancer) and mapped with ECS and got the ALB (CName) domain. We have created new listener rules to route requests to targets API is routing (Path base routing) http://umojify-alb-1987551880.us-east-1.elb.amazonaws.com

  • Finally, we got the response "502 Bad Gateway" and "Status code: 405". Please guide us on this issue.

  • Where and why the issue came? Is it for ALB or API?

API URL: http://umojify-alb-1987551880.us-east-1.elb.amazonaws.com/save-user-rating

AWS ECS uses dynamic ports to connect to the microservice containers. Please check if the ports are open on the container hosts(instances). I faced the same issue and had to open all the TCP ports for the ALB. See the AWS documentation for configuring the security group rules for container instances - AWS security group rules for container instances

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM