简体   繁体   中英

How to access website deployed on Google cloud VM?

I have a small Spring Boot application deployed on Google cloud VM. I have reserved a public IP for it. I have enabled DNS Zone, created A, CNAME records as well as I have put the provided google nameservers in GoDaddy DNS configuration. When I run nslookup mywebsite.com in the terminal. I am getting the correct IP address of the website. Also, the website is accessible through IP address. But I am unable to access it via domain name, ie

http://IP_ADD:8080 : Works successfully.

mywebsite.com : Doesn't work. I get: www.mywebsite.com refused to connect.

The firewall rules in the google cloud VM instance are as follows:

防火墙规则

Some of the articles which I have followed: https://vinoaj.com/guides/2018/google-cloud-dns-for-godaddy-domain/

Also followed, google docs on the same topic. Which are also the same as the article.

Please, be aware that you are trying to access www.mywebsite.com while it seems you configured mywebsite.com in your DNS records. They are not the same thing.

Please, be sure that you configure a CNAME record for www.mywebsite.com . Consider, for example, this related SO question, or this other one.

Also, pay attention in that you are accessing your web app on port 8080. You need some kind of web server, proxy, or service, like a load balancer, that redirects the traffic from port 80 and/or port 443 to the one in which your application is listening, 8080 .


As another useful link, you could also check Google Cloud DNS Best Practices .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM