Score:0

link custom domain (name.com) to Azure vm laravel & nginx

cn flag

Good day, I have a Laravel application on an Azure Virtual machine using Nginx in the ubuntu VM. I wanted to link it to the custom domain I purchased on name.com... Those are the steps that I did so you can track with me the issue because I ran out of options:

VM SIDE:

  • I created static IP on my VM.
  • I created my DNS name on my VM.
  • I opened ports: (80, and 443) on my VM.
  • I added my domain as server_name in the Nginx config of (sites-available and sites-enabled).
  • I opened ports: (80, 443) in Nginx.
  • I created a DNS Zone for my resource.

Name.com SIDE

  • I added : a record: host: @, answer: my public IP of VM
  • I added : a record: host: *, answer my public IP of VM
  • I added : CNAME record : host: www, answer: my DNS name
  • I added : TXT record : host : @, answer : MS=value

after searching I added the DNS nameservers I got from the DNS Zone of Azure.

I waited after changing every single step of the steps above and it didn't work.

What I get is:

Hmm. We’re having trouble finding that site.
We can’t connect to the server at bcwa.app.
If that address is correct, here are three other things you can try:
Try again later.
Check your network connection.
If you are connected but behind a firewall, check that Firefox has permission to access the Web.

What did I do wrong? What should I do next? To the point that I checked my domain on DNS Checker and it returned the public IP address correctly.

When I get online on my public IP and DNS name link they direct me to my application which is correct.

I'm new to Azure and setting up these configurations so I'll be glad if someone helped me as soon as possible.

ng flag
Where are you hosting your DNS zone? You seem to have added records to a zone at name.com, but also setup NS records to point to Azure DNS. You can't do both, so where is your zone?
Rose Riyadh avatar
cn flag
@SamCogan that's correct I added them in both, should I return the dns in name.com?
ng flag
You need to pick one, either name.com is your dns provider or azure is, and out records there
Rose Riyadh avatar
cn flag
@SamCogan I removed dns providing from name.com and only added nameservers to the domain that I got from dns zone in aure, is this correct? + I have a problem now.. It's reaching the backend side (laravel) but it's showing on the browser unable to connect + if I check it without https on curl it shows my html and checked the server side it's showing 405 in the nginx log, any idea of what should i do ?
ng flag
That’s down to your application, which is responding with that error code. Without knowing how your app works I have no idea.
Rose Riyadh avatar
cn flag
@SamCogan I have searched a lot about this problem but I can't decide which permission is to add to my nginx to remove 405 and 403 errors
Rose Riyadh avatar
cn flag
@SamCogan thank you so much for your help, if you can add it as an answer so I can solve this problem and post my current issue
ng flag
405 is a method not allowed error, so probably not permissions. But this is not an Azure issue any more as your DNS is working so I suggest you post another question with full details of errors, logs and config.
Rose Riyadh avatar
cn flag
@SamCogan this is the problem's question https://serverfault.com/questions/1102058/ubuntu-server-not-allowing-domain-to-access-laravel-project-405
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.