0
votes

I have a windows EC2 instance hosted in a Private Subnet.

This private subnet has a NAT Gateway.

My need is to access the web site hosted on this EC2 instance, from the internet.

Following are the options that I tried but failed.

  • Created an internet facing NLB -> Created listener -> connected lister to a Target Group, that has the EC2 instance registered.

  • Tried with Created Classic load balancer.

The security group of the EC2 Instance has the following settings

Source for HTTP and HTTPs is 0.0.0.0/0 source for RDP is 0.0.0.0/0

Could anyone help me understand the right approach?

1
does your securiy group allow your ip to hit the NLB?M Hamza Razzaq
NLB does not have a security group. Could you clarify which Security group are you mentioning?KurioZ7
Are you sure that the web server is working on the Windows instance?John Rotenstein
Yes, the web server is working, because I can access the web application from a windows jumbox server.KurioZ7
make sure that the subnet of your load balancer and EC2 are with in the same vpc. And another thing to make sure that your load balancer listener rule is hitting the same port on which your application is running. and security group if EC2 allow that port in its in bound rule.M Hamza Razzaq

1 Answers

0
votes

What are you using for your internal routing? Having the loadbalancer tied to the EC2 will allow you to get to the EC2 machine but the service you are running within it usually requires an overlay network that routes the incoming traffic to your service at the respective port.

If you have not set this up, I would recommend looking at either traefik or nginx.

Hope this helps