【发布时间】:2014-03-30 20:02:14
【问题描述】:
我有一个 Web 服务器在 Ubuntu Amazon EC2 实例的 3000 端口上运行。15.0.0.10 是这个 EC2 实例的私有 IP。
在我 ssh 进入此实例并运行以下命令 curl localhost:3000/index.html 后,它会返回我的 index.html 页面的 html 源代码。
但是当我运行curl 15.0.0.10:3000/index.html 时,它会说:
curl: (7) couldn't connect to host
- 为什么会这样?
- 如何使第二个命令也返回内容?
【问题讨论】:
-
是的。在 ifconfig 输出的 eth0 中,
inet addr:15.0.0.10
标签: curl amazon-web-services amazon-ec2