Search code examples
node.jsazureazure-web-app-servicedomain-name

How to configure a custom domain name for web app running on port 80 in non-classic azure virtual machine


I created a NodeJs web on non-classic virtual machine in Azure cloud. Then I started the app on port 80 as follows:

sudo NODE_ENV=production PORT=80 node server/app.js

The app started successfully. I also enabled port 80 using NSG.

I can access the app using IP address.

Now I purchased a domain name in names.co.uk and linked the IP address to record A(on registrar site). The same way as I was doing for the AWS site which is currently working.

But I could not access the app using custom domain name but app can be accessed directly using IP address.

Any help in this regard will be much appreciated.


Solution

  • The way I did is absolutely correct. The only problem was that it took some time to get the changes reflected.