Search code examples
amazon-web-servicesamazon-vpcamazon-elbhealth-check

AWS target group health check fails with 403


I have created a VPC with a public and a private subnet. I have launched an instance in each one of the subnets.

The SG of the private instance allow SSH and HTTP from the SG of the public instance.

The SG of the public instance allow SSH from my IP.

I SSH'ed into the public instance and then SSH'ed into the private instance and installed and started httpd.

CURL command from the public instance which invokes the private instance give me 200 response.

Now, I created a target group that contains the private instance with HTTP port 80 for health check. I Used an Application load balancer that has a listener on port 80 to the above mentioned target group. The ALB has the same SG as the public instance.

The issue is that the health check in the target group is failing.

Things I have checked.

  • Private instance SG allows SSH and TCP from the public instance SG.
  • ALB has the same SG as the public instance From the public instance. ​
  • I ​am able to SSH into the private instance and also reach CURL on port ​80.
  • I have not touched the NACLs for the VP.

What else should I be checking to resolve this?


Solution

  • I checked the error logs for apache at /var/log/httpd and saw that it explicitly wanted an index.html file at /var/www/html.

    I created the file and restarted httpd and I was able to see successful health checks.