I installed a node.js application on an EC2 server under windows at Amazon Web Services (AWS). The application works well in localhost on port 80 but not with the elastic IP address associated with the server instance.
If I add this address as a parameter of the listen function:
app.listen(port,'xxx.xx.xxx.xxx', () => {
console.log(App listen on port ${port}!
)
});
I get the error: Error: listen EADDRNOTAVAIL: address not available xx.xx.xxx.xxx:80
On the other hand, it works well locally if I put the IP address provided by ipconfig
Furthermore, it works perfectly with IIS or an apache server with the elastic ip address or a domaine name