简体   繁体   English

Azure Ubuntu VM应用程序只能在端口80上连接

[英]Azure Ubuntu VM application only able to connect on port 80

I have an Ubuntu16.04 VM on Azure, and am trying to run a node server on it. 我在Azure上具有Ubuntu16.04 VM,并尝试在其上运行节点服务器。 When I bind the port to 80, I am able to access it from my browser ( http://abcd:80 ). 将端口绑定到80后,便可以从浏览器( http:// abcd:80 )访问它。 However, if I try to instead bind the server to a different port, such as 3300 or 8080, the browser times out when trying to connect to it. 但是,如果我尝试将服务器绑定到其他端口,例如3300或8080,则浏览器尝试连接时会超时。 ( http://abcd:3300 ) http:// abcd:3300

I have ensured that: 我确保:

  1. There exists an inbound security rule for port 3300 in the NSG NSG中存在端口3300的入站安全规则
  2. The windows firewall of the machine of the browser allows port 3300 (I have even tried temporarily turning it completely off but to no avail) 浏览器计算机的Windows防火墙允许端口3300(我什至尝试暂时将其完全关闭,但无济于事)
  3. I am not using an azure load balancer 我没有使用天蓝色的负载均衡器
  4. I am starting node with root privileges 我正在使用root特权启动节点
  5. Node is bound to (port, "0.0.0.0") 节点绑定到(端口“ 0.0.0.0”)
  6. I am listening on the correct port (I think?) netstat -ant | grep 3300 (我认为),我听的正确端口netstat -ant | grep 3300 netstat -ant | grep 3300 gives netstat -ant | grep 3300

    tcp6 0 0 :::3300 :::* LISTEN

I have spent a few hours now researching on the internet how to get it to work and tried everything I could find, but to no avail. 我现在花了几个小时在互联网上研究如何使其工作,并尝试了所有我能找到的,但无济于事。 If anyone has any input i'd be happy to try it out. 如果有人有任何意见,我将很乐意尝试。

Jason was correct, it was a ufw issue. 杰森是正确的,这是一个普遍存在的问题。 If anyone comes across this question in the future, I solved it with the command 如果将来有人遇到这个问题,我可以使用以下命令解决

sudo ufw allow proto tcp from any to any port 3300

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM