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 .
source share