简体   繁体   English

如何访问托管在私有子网中的 Windows EC2 实例中托管的网站?

[英]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.我有一个托管在私有子网中的 Windows EC2 实例。

This private subnet has a NAT Gateway.这个私有子网有一个 NAT 网关。

My need is to access the web site hosted on this EC2 instance, from the internet.我需要从 Internet 访问托管在此 EC2 实例上的网站。

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.创建一个面向互联网的 NLB -> 创建侦听器 -> 将列表连接到目标组,该组已注册 EC2 实例。

  • Tried with Created Classic load balancer.尝试使用创建的经典负载均衡器。

The security group of the EC2 Instance has the following settings EC2 Instance 的安全组有以下设置

Source for HTTP and HTTPs is 0.0.0.0/0 source for RDP is 0.0.0.0/0 HTTP 和 HTTPs 的来源是 0.0.0.0/0 RDP 的来源是 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.将负载均衡器绑定到 EC2 将允许您访问 EC2 机器,但您在其中运行的服务通常需要一个覆盖网络,将传入流量路由到您在相应端口的服务。

If you have not set this up, I would recommend looking at either traefik or nginx .如果您还没有设置它,我建议您查看traefiknginx

Hope this helps希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何访问私有子网中的 EC2 实例? - How to access to EC2 Instance in private subnet? 如何使用站点到站点 VPN 访问私有子网 EC2 - How to Access Private Subnet EC2 with site to site VPN 如何从另一个私有子网的ec2实例访问私有子网中的RDS实例? - How to access RDS instance which in private subnet from ec2 instance from another private subnet? 如何在私有子网中托管的 EC2 上使用 aws-cw-agent(没有 NAT 网关) - How can I use aws-cw-agent on an EC2 hosted in private subnet ( without NAT gateway) 如何打开对Windows EC2实例上托管的ElasticSearch服务器的外部访问? - How to open outside access to ElasticSearch server hosted on Windows EC2 instance? 如何在私有子网中获取 EC2 实例私有 IP? - How to get EC2 instance private IP in a private subnet? 使用负载均衡器替换 弹性 ip 对托管在 AWS 中 EC2 实例上的 web 应用程序的访问 - Replace eleastic ip access to web app hosted on EC2 instance in aws with load balancer 对于托管在 CloudFront 后面的 EC2 实例上的站点,如何将非 www 流量重定向到 www? - How to redirect non-www traffic to www for site hosted on EC2 instance behind CloudFront? 无法访问托管在 AWS EC2 实例上的网站 - Unable to access website hosted on AWS EC2 Instance 无法访问托管在 AWS EC2 实例上的我的 Django 页面 - Cannot access my Django page hosted on AWS EC2 instance
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM