在服务器配置之后,我有一个 IIS 服务器在我的 EC2 实例中侦听端口 80。我可以从我的弹性 IP 访问它。但我关闭了 IIS 服务器,希望在端口 80 上启动我的节点服务器。
现在,两者都不起作用!我的节点应用程序侦听端口 80,但无法通过弹性 IP 从外部访问。我试图在 IIS 管理器中启动 IIS 服务器,它看起来像打开了。但它无法在实例内(使用私有 IP)或从外部访问。
我能做些什么来解决它?
谢谢
服务器.js
/*******************************************************************************************/
/*CREATE AND START SERVER*/
/*******************************************************************************************/
var fs = require('fs');
var html = fs.readFileSync('./public/index.html');
var server=http.createServer(function(req,res){
//res.write(html); // load the single view file (angular will handle the page changes on the front-end)
//res.end();
// application -------------------------------------------------------------
app.get('*', function(req, res) {
res.sendfile('./public/index.html'); // load the single view file (angular will handle the page changes on the front-end)
});
});
server.listen(80,'localhost');