2
votes

I created VPC with public and private subnets like this:

  • public subnet : bastion server, elastic load balancer, igw
  • private subnet : ec2 instance(app is running with http 8080 port), nat gateway

Following is the listeners config.

  • load balancer protocol : http
  • load balancer port : 80
  • instance protocol : http
  • instance port : 8080

When I try with the command 'wget -O - http://elb-xxxxx.us-west-2.elb.amazonaws.com', the result is

Resolving elb-xxxxx.us-west-2.elb.amazonaws.com (elb-xxxxx.us-west-2.elb.amazonaws.com)... 
52.x.x.x., 52.x.x.x, 54.x.x.x, ...
Connecting to elb-xxxxxx.us-west-2.elb.amazonaws.com (elb-xxxxxx.us-west-2.elb.amazonaws.com)|52.x.x.x|:80... 
failed: Connection timed out.

However, status of load balancer is 'inService' and elb's healthcheck is working!(elb is calling the app's api normally)

When I installed my app on the bastion server in the public subnet, I could access to the app with web broswer and it worked normally.

In sum, VPC and its routing configuration seem to be correct, and elb is also watching the instance correctly.

However, if I try to access to app through elb with elb's DNS name, connection timed out error occurs.

I am stuck in this and need help from you..

2
If the balancer's security group settings are correct, then usually this is caused by mistakenly placing the ELB on the private subnet. Double check that?Michael - sqlbot

2 Answers

2
votes

I found the problem by myself. I mistakenly added both public and private subnet to elb.. Thanks though..!

1
votes

Did you by any chance neglect to provide a security group with inbound port 80 open for your load balancer? Here's a link re: setting up security groups for ELB in EC2-classic or VPC.