简体   繁体   English

AWS Linux 实例公共 IP 不工作

[英]AWS Linux instance public IP is not working

I have created an AWS EC2 Linux instance and installed Nginx on it.我创建了一个 AWS EC2 Linux 实例并在其上安装了 Nginx。 Both EC2 and Nginx statuses are " Running ". EC2 和 Nginx 状态均为“正在Running ”。 The problem is both Public IP and DNS are not working.问题是公共 IP 和 DNS 都不起作用。 When I put the public IP to the browser, it is keep loading for a while and then shows "This site can't be reached"当我将公共 IP 放入浏览器时,它一直在加载一段时间,然后显示“无法访问此站点”

I tried by adding a new Inbound rule with Custom TCP and still the result is the same.我尝试使用Custom TCP添加新的入站规则,但结果仍然相同。

The VPC is also in the " Available " state and the IPv4 CIDR status is " Associated ". VPC 也在“ Available ”state 中,IPv4 CIDR 状态为“ Associated ”。

What could be the issue here?这里可能是什么问题?

Some steps to pay attention to:一些需要注意的步骤:

  1. In the security group your instance you have to enable HTTP inbound traffic on port 80 from anywhere:在您的实例的安全组中,您必须从任何地方在端口80上启用 HTTP 入站流量: 在此处输入图像描述 This will let your EC2 instance receive HTTP traffic ( not HTTPS! )这将使您的 EC2 实例接收 HTTP 流量(不是 HTTPS!
  2. When you put the IP address in your browser, make sure you specify the protocol: http://1.2.3.4/... .当您在浏览器中输入 IP 地址时,请确保指定协议: http://1.2.3.4/... It is important to explicitly type out http , because nowadays browsers default to using HTTPS.明确输入http很重要,因为现在的浏览器默认使用 HTTPS。 You do not allow HTTPS traffic yet.您还不允许 HTTPS 流量。

At this point you should have HTTP connection.此时您应该有 HTTP 连接。 For HTTPS you would want to allow inbound traffic on port 443 and you would have to set up SSL, but this falls outside of the scope of this question.对于 HTTPS,您希望允许端口443上的入站流量,并且您必须设置 SSL,但这不在此问题的 scope 范围内。

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

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