As a lead in to deploying the Ghost blogging platform, I am checking that node.js can be deployed on my Amazon EC2 instance with Ubuntu 13.04
The Ghost Github page even gives step by step instructions on how to deploy to EC2 and verifying node
is an important step.
I put the node sever in /var/www/index.js
and ran node index.js
so it should be listening on port 8080
require("http").createServer(function(request, response){
response.writeHeader(200, {"Content-Type": "text/plain"});
response.write("Hello World!");
response.end();
}).listen(8080);
I was unable to connect to: http://ec2-xx-xx-xx-xx.compute-1.amazonaws.com/ with Chrome
At this point I backtracked and put in the following inbound TCP rules:
22 (SSH) 0.0.0.0/0 Delete
80 (HTTP) 0.0.0.0/0 Delete
443 (HTTPS) 0.0.0.0/0 Delete
8080 (HTTP*)0.0.0.0/0 Delete
Good news although curl 127.0.0.1
gives:
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.4.5</center>
</body>
</html>
curl 127.0.0.1:8080
gives Hello World!
.
Why can't I connect to node from my home computer?