Access VM on nginx server

Jevon Davis 141 Reputation points
2022-10-24T18:38:34.327+00:00

I tried accessing a nginx server that is hosting a website on my Azure VM. Typically I would make the changes for localhost and browse to the website in question with the relevant port appended to it. For eg. http://x.x.x.x for port 80 or if it is any other port then http://x.x.x.x:3678. I cannot do this anymore so I am wondering if there are other setting to make this possible. On the VM I can get to the page with the private IP and the domain in question but outside the VM I cannot reach it with either the public IP or privtate IP

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,762 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. rafalzak 3,251 Reputation points
    2022-10-25T19:32:33.85+00:00

    Hi @Anonymous ,

    Did you setup NSG and allow access to the vm from Internet to port 80 for example?

    Private IP can be only routed in the same network or VPN connection so if you want to access nginx from your PC via public IP please check if you have proper firewall rules in place.

    Please upvote or accept as answer if it helped.

    1 person found this answer helpful.

  2. Dillon Silzer 57,826 Reputation points Volunteer Moderator
    2022-10-24T18:42:24.107+00:00

    Hi @Anonymous

    You should check the Public IP address / associate one using the following guide:

    https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/associate-public-ip-address-vm#azure-portal

    253643-image.png

    --------------------------------

    If this is helpful please accept answer.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.