简体   繁体   中英

Cannot connect to http port on Azure Ubuntu VM

I have an Ubuntu VM running on Azure. (Resource Manager rather than Classic) I am running an application server on there (similar to Tomcat) that serves http on port 9001.
I created an Inbound rule to allow traffic on port 9001.
Also created an Outbound rule to allow traffic out on port 9001.

My application server is running (tested locally with curl).

When I try to test it remotely via http://:9001/somepath, the connection seems to be getting blocked.

I can successfully connect to this VM via SSH and SFTP

[update] Here is my NSG. This NSG is associated with the subnet of the VM.

NSG Image

Please check your NSG settings, NSG is associated with the NIC & subnet, make sure you have add port 9001 to NSG inbound rules.

Please check your Ubuntu firewall settings, make sure you have allow port 9001. Run this command to check it, sudo ufw status

Also, please check your application listening on port 9001, and bound IP same as 10.0.0.4 or 0.0.0.0 , if your application bound IP address is 127.0.0.1, it will work for localhost, we can't access it from outside. To check it, please run this command netstat -ant | grep 9001 netstat -ant | grep 9001 . like:

tcp        0      0 0.0.0.0:9001              0.0.0.0:*               LISTEN 

Update :
It is a NSG settings issue, please check your NSG settings:
1.subnet NSG, if the subnet associate with a NSG, we should add port 9001 to NSG inbound rules.
在此处输入图片说明 2.NSG settings: 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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