首页 > 解决方案 > 如何从我的 AWS linux EC2 实例调用浏览器

问题描述

我在我的 aws ec2 实例上的端口 8000 上启动了一个 nodejs 应用程序。我能够执行 wget 并在屏幕上看到输出代码。


wget http://localhost:8000 --2018-10-22 13:40:17-- http://localhost:8000/ Resolving localhost (localhost)... 127.0.0.1 连接到 localhost (localhost)|127.0。 0.1|:8000... 已连接。HTTP 请求已发送,等待响应... 200 OK 长度:366 [text/html] 保存到:'index.html'</p>

index.html 100%[============================================= =================================>] 366 --.-KB/s in 0s

2018-10-22 13:40:17 (73.9 MB/s) - 'index.html' 已保存 [366/366]


我打开了端口号。8000 在我的 EC2 实例上使用入站和出站的安全组设置。我仍然可以使用http://ipaddress:8000访问。请在浏览器上查看我的应用程序的任何其他建议

安全组设置

标签: amazon-web-servicesaws-security-group

解决方案


您能否将绑定 IP 地址从 更改localhost0.0.0.0并尝试。

通过指定 0.0.0.0,服务器将绑定到所有 IP,允许“localhost”继续工作(本地)以及允许通过机器的 IP 或主机名从外部设备访问服务器。


推荐阅读