简体   繁体   中英

How to access web site hosted in Windows EC2 instance, hosted in a Private Subnet?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM