I've got an EC2 instance behind a load balancer which is failing the health check. When I look at the target group / targets, the instance says Status: unhealthy, Status details: Health checks failed.
The instance itself is fine. How do I troubleshoot / debug this problem?
The load balancer does route requests to the instance on port 8081, and they work. The app is running ok. My guess is that is because a load balancer will "fail open".
The health check url is
http://my_host_name:8082/healthcheck
. When I go directly to that url (with an IP address as hostname), bypassing the load balancer, I get a 200 OK.Target group health check settings: HTTP, port: 8082, path: /healthcheck. All correct, so far as I know.
The request logs on the instance do not show that it is receiving a call to /healthcheck at all.
I'm using the default VPC security group, which has the default rule of all traffic from another instance in the security group is allowed. I have checked that both the instance and the load balancer are in the security group. Both are in the same VPC.
The instance is in Availability Zone us-east-2c. I confirmed that the load balancer includes that zone. (I can't tell what zone the load balancer itself is in. The arn just says us-east-2.)
The load balancer forwards to the correct target group.
I'm guessing that it has something to with the fact that the app is on :8081 and the healthcheck is on :8082, but I really think I configured it correctly.
What am I missing here? How do I debug this?