Azure端口80上的Express和PM2

时间:2018-04-05 14:14:05

标签: node.js azure express pm2

我的问题如下:

我有一台运行Ubuntu 16.04的Azure VM,我有一个Express应用程序

http.createServer(app).listen(80, function(){
 console.log('App running on port 80'.);
});

我允许ufw启用端口80,Azure规则也是如此。

我已完成sudo setcap 'cap_net_bind_service=+ep' /usr/bin/node

然后我pm2 start index.js

应用程序启动没有日志,但我尝试从我的本地计算机访问它并获取:

curl -I http://parse.sensa-platform.com/public/test.txt
curl: (7) Failed to connect to parse.sensa-platform.com port 80: Connection refused

应该输出Banans

我可以在VM内curl

不知道该怎么做。请帮忙。

netstat -an | grep 80
tcp        0      0 10.0.0.4:45152          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45282          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45262          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45202          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:44480          13.95.240.73:443        TIME_WAIT  
tcp        0      0 10.0.0.4:45312          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45292          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45232          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45212          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45192          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45252          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45162          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45172          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45222          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45322          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45182          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45272          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45242          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45302          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:45142          168.63.129.16:80        TIME_WAIT  
tcp        0      0 10.0.0.4:44380          13.95.240.73:443        TIME_WAIT  
tcp6       0      0 :::80                   :::*                    LISTEN

0 个答案:

没有答案