title: AWS Load Balancer EC2 health check request timed out failure
body: <p>I'm trying to get down and dirty with DevOps and I'm running into a health check request timed out failure. The problem is my Elastic Load Balancer sends a health check to my EC2 instance and gets a network timeout. I'm not sure what I did wrong. I am following <a href="http://www.clovescarneirojr.com/2016/02/10/deploy-rails-app-to-aws-vpc-ec2-rds-elb.html" rel="noreferrer">this tutorial</a> and I have completed all the steps up to and including "Using a Elastic Load Balancer". My EC2 instance seems to be working fine and I am able to successfully curl localhost on port 9292 from within the EC2 instance.</p>
  
  <p>EC2 instance security group setup:
  <a href="https://i.stack.imgur.com/xrWmB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xrWmB.png" alt="description"></a></p>
  
  <p>Elastic Load Balancer  setup:
  <a href="https://i.stack.imgur.com/3FfEN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3FfEN.png" alt="enter image description here"></a></p>
  
  <p>My target group for the ELB routing has port 9292 open via HTTP and here's a screenshot of the target in my target group that is unhealthy.
  <a href="https://i.stack.imgur.com/NsDJv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NsDJv.png" alt="enter image description here"></a></p>
  
  <p>Health check config:<a href="https://i.stack.imgur.com/phq44.png" rel="noreferrer"><img src="https://i.stack.imgur.com/phq44.png" alt="enter image description here"></a></p>
  
  <p>I have a VPC that my EC2 instance is a part of and my ELB is connected to the same VPC. I do not have Apache installed and I do not have nginx installed. To my understanding, I do not need these. I have a Rails Puma server running and I can send successful curl requests to the server.</p>
  
  <p>My hunch is that my ELB is not allowed to reach my EC2 instance, resulting in a network timeout and a failed health check. I'm unable to find the cause for this. Any ideas? This <a href="https://stackoverflow.com/questions/39214606/aws-elb-load-balancers-keeps-failing-health-check-http">SO post</a> didn't help much. Are my security groups misconfigured? What else could potentially block a routing request from ELB to my EC2 instance?</p>
  
  <p>Also, is there a way to view network requests / logs for my EC2 instance? I keep seeing VPC flow logging but I feel like there are simpler alternatives.</p>
  
  <p><a href="https://forums.aws.amazon.com/thread.jspa?threadID=257196" rel="noreferrer">Here's something</a> I posted in the AWS forums but to no avail.</p>
  
  <p>UPDATE: I can curl the private IP of target just fine from within an EC2 instance. I don't think it's the target instance, I think it's something to do with the security group setup. I am unable to identify why though because I have basically allowed all traffic from the Load Balancer to the EC2 instance.</p>