EC2 Curl Amazon Exam

I have a web server running on an Ubuntu Amazon EC2 instance on port 3000. 15.0.0.10is the private ip of this EC2 instance.

After I ssh into this instance and run the following command curl localhost:3000/index.html, it returns me the html source of my index.html page.

But when I started curl 15.0.0.10:3000/index.html, it says:

curl: (7) couldn't connect to host
  • Why is this happening?
  • What can I do so that the second command also returns the contents?
0
source share
1 answer

You need to make sure that the server is running at 0.0.0.0 if you need it to be accessible by addressing any IP instance.

localhost (127.0.0.1), . 0.0.0.0:3000. .

+2

Source: https://habr.com/ru/post/1529195/


All Articles