amazon-web-services - 如何从我的 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访问。请在浏览器上查看我的应用程序的任何其他建议
解决方案
您能否将绑定 IP 地址从 更改localhost
为0.0.0.0
并尝试。
通过指定 0.0.0.0,服务器将绑定到所有 IP,允许“localhost”继续工作(本地)以及允许通过机器的 IP 或主机名从外部设备访问服务器。
推荐阅读
- angular - 角度万能载荷两次
- linux - 如何在 zshrc 的别名中自动添加用户输入?
- c# - c# excel将图片插入单元格
- c# - 使用 Unity 的新输入系统:一个按钮可以做不同的事情吗?
- mongodb - 从 mongodb 中的特殊字符中清除文档
- c# - 在异步任务中等待?
- java - Spring Security:无法同时拥有经过身份验证和未经身份验证的端点
- php - PDFlib 表格边框仅位于行的底部
- c# - 将日期时间格式 {"MM/dd/yyyy"} 更改为 {"dd/MM/yyyy"} 并且 Unity 中的时间应该保持不变
- css - Vaadin + LitElement - 来自`get styles()`的样式没有被应用