3
我試圖運行一個基本的node.js服務器,我無法訪問我的node.js服務器上我的AWS EC2 isntance從外面
var http = require('http');
http.createServer(function(req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('hello world!\n');
}).listen(3000, '0.0.0.0', function() {
console.log('Server running on port 3000');
});
然而,當我運行它,去http://x.x.x.x:3000/該頁面不加載。
我試過this question的答案,但那也沒有效果。並且將主機更改爲127.0.0.1
或服務器IP或發送它也不能修復它。
我也跟着this guide說,代理請求與haproxy。但是那也行不通。
安全選項卡中是否有某些東西需要啓用/禁用?
編輯:問題是我使用了錯誤的IP。實例重新啓動時,IP會發生變化。
感謝您的良好的聯繫。 – fent 2012-02-19 10:53:16