Cannot access port 8080 on EC2 (AWS)

I just started a new instance of AWS EC2. In the instance security group, I added a new rule to open port 8080. I also stopped the iptables service for the instance in another entry. Therefore, theoretically, this port should be wide open.

I started the RESTful service on 8080 and was able to access it locally through curl.

When I come with curl remotely, I get a message stating that it cannot connect to the host.

What else should I check if the 8080 is really open?

+4
source share
1 answer

I started the RESTful service on 8080 and was able to access it locally through curl.

What technology is your RESTful based service?

Currently, many frameworks only listen on localhost ( 127.0.0.1 ), whether by default or using their own examples, see, for example, the canonical Node.js one (I understand that port 8080 hints at Java / Tomcat):

 var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/'); 

The log message generated at startup is the server running at http: // 127.0.0.1 : 1337 / - the underlined part is the key, that is, the server is configured to listen on the IP address 127.0.0.1 , while you are trying to connect to it via Amazon EC2's public IP address .

0
source

All Articles