0

I've got app on GCP up and running. I can view the app after typing its external IP so I know the app works fine.

Now I'm trying to point domain purchased on Godaddy to it. After following a tutorial I got 404 from the browser.

cloud DNS zone:

cloud DNS zone screenshot

Godaddy DNS records for the domain: enter image description here enter image description here

According to tutorial after taking these steps I should be able to access my app after typing the domain in. I'm getting 404.

Any help is much appreciated.

Nginx config:

enter image description here

Web server is running fine: enter image description here

Update:

I've made changes based on your feedback:

Godaddy nameservers are now replaced with GCP nameservers GCP zone DNS config

Mark
  • 101
  • 1
  • 5
  • 404 is an HTTP error. It has nothing to do with DNS. Check your web server logs and configuration. – Esa Jokinen May 09 '21 at 08:30
  • 2
    The `NS` records at godaddy look very strange as that is clearly a screenshot of a zone hosted at godaddy, not the delegation of the zone? Did you mean to delegate the zone to google domains, instead? – Håkan Lindqvist May 09 '21 at 11:26
  • @EsaJokinen I've added my Nginx config. Judging the fact that the app loads fine when typing in external IP of the server is telling me that the config is OK. – Mark May 09 '21 at 12:41
  • Screenshots added. Logs are clean and server is running fine too. – Mark May 09 '21 at 12:51
  • What @HåkanLindqvist noticed is probably correct. You don't change the authoritative name servers by modifying the NS records on the former zone, but it has a [different procedure](https://www.godaddy.com/help/change-nameservers-for-my-domains-664). Also, you can debug using e.g. `dig example.com @1.1.1.1 +trace`. – Esa Jokinen May 09 '21 at 15:46
  • @EsaJokinen I only did that because it worked for the guy in YouTube tutorial. I admit I know very little about how nameservers and DNS work. – Mark May 09 '21 at 15:51
  • I've added update to my question reflecting suggested changes. – Mark May 09 '21 at 16:00
  • The`dig` command hasn't revealed any errors. – Mark May 09 '21 at 16:04
  • @EsaJokinen - 404 is sometimes related to DNS problems in Google Cloud (HTTP Load Balancers and Custom Domains for some services). – John Hanley May 09 '21 at 17:58
  • 1
    Frankly, it's hard to investigate this because you obfuscate the domain and the IP address, while it would be trivial if you didn't. If it's sensitive and you can't figure it out by yourself, you could hire a professional. – Esa Jokinen May 09 '21 at 18:55
  • @EsaJokinen All of the sudden the domain started to work. It's now pointing to the app. I don't why it suddenly works. I haven't changed anything for the last 2 hours. – Mark May 09 '21 at 19:42

1 Answers1

0

When you change your NS records to GCP that means you are changing where the DNS records for the domain is existing on in that case adding A records on godaddy won't make any changes you have to add A record and Cname records on GCP

Abhijith
  • 15
  • 8
  • Please review update I added to the question. – Mark May 09 '21 at 16:07
  • Yes just saw that if it is giving youa 404 error that means there is something wrong with the nginx conf file does it work if you manually call it using index.php or any file that serves the website – Abhijith May 09 '21 at 16:09
  • I can confirm that when I stop Nginx and run the app only on Gunicorn (http server) the app loads OK on port 5000, then I restart the Nginx and the app loads OK on port 80 of the external IP but throws 404 when I use my domain. – Mark May 09 '21 at 16:17