简体   繁体   中英

Web server on Azure VM

I've installed a Windows 2012 R2 VM (free tier) and enabled all ports for external communication (including port 80).

I logged in to my VM and installed nginx webserver (I've also tried to python development server).

I can access the website internally on the VM (using 127.0.0.1 or the internal address of the server 10.1....) but when trying to access it from outside, using the external IP address (which is also the IP address I used in order to login to my server using RDP) I get no response.

Can you please help me understand what I'm doing wrong?

Thanks!

As @evilSnobu points out from his comments, the short answer is to allow the TCP port 80 in the windows firewall on windows VM itself.

Usually, we could login to that Windows VM and run the CMD command netsh advfirewall set allprofiles state off to disable the windows firewall temporarily. Then we can use telnet tool to check if TCP 80 port can be connected.

When we face the same issue no response outside of Azure VM. we can try one or more of the followings:

  • There is an NSG at the subnet level or NIC level as well which is not allowing data through.
  • There is a firewall on the VM itself (windows firewall etc.)
  • There is nothing listening on that port. It should be listening on 0.0.0.0 instead of 127.0.0.1 when you use netstat -ano in the windows CMD.
  • The service is not staring when you verify the port listening.
  • Outbound traffic with a specific port is denied from your local machines.

Hope this helps.

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