Question

 

Target instances registered with LB's Target Group are in an unhealthy state. The Health status details indicate that a 404 error code is occurring.

 

What should I check?

 

 

Answer

 

First of all, there are many reasons for 404 errors, and it usually occurs most often when a page or files requested by users cannot be found in HTTP.

 

The most common cause may be that the page is not in that directory, moved, or deleted.

 

It's a good idea to check the contents below one by one.

 

1. Firewalls

The port registered in the target group may not have been allowed in the target instance firewall.

 

2. Path Directory

Please make sure that the health check path actually exists and that the html file exists in that path.

 

For more information, please refer to the links below.

 

#1 Stack overflow -

https://stackoverflow.com/questions/53936905/aws-load-balancer-404-error-with-path-routing

 

 

 

3. Other Technical Documents

I am sending you a link for your reference regarding setting ALB listener rules and checking the status of the target group. It is also a good idea to check the link from the beginning.

 

#2 Listener rules for ALB -

https://docs.aws.amazon.com/ko_kr/elasticloadbalancing/latest/application/listener-update-rules.html

 

#3 Health checks for your target groups-

https://docs.aws.amazon.com/ko_kr/elasticloadbalancing/latest/application/target-group-health-checks.html