2
votes

I've been running a successful Wordpress install on Google Compute Engine with LEMP (Linux, NGINX, MySQL and PHP) stack, and Cloud SQL (Generation 2 MYSQL) and tried to tie in the domain last night using Cloud DNS.

I added the A record and CNAME and adjusted the nameservers in Google Domains, but nothing is loading.

At first, I was getting a 504 Bad Gateway NGINX/Ubuntu error, but now nothing happens.

However, I noticed that my IP address for Compute Engine changed, not sure how probably misunderstood something that I was reading and said yes.

Is there a way to change the Cloud SQL to see the new IP address? If so what is the process?

Trying to avoid having to rebuild everything, but I guess that's how you learn what not to do in the future.

2

2 Answers

2
votes

Every Google Compute virtual machine has assigned by default an ephemeral IP address, which gets changed every time you restart it. You can read more about IPs, however I recommend you just promote the current ephemeral address as a static one and update your Wordpress config settings.

Please keep in mind that you could be in a security risk at this moment, because the old IP address that you granted access to your database might be assigned to another user.

0
votes

In addition to Alex Palcuie's great answer re promoting a VM's ephemeral IP to a static IP, here's how you reconfigure Cloud SQL to allow only the new IP address.