[英]How to access website deployed on Google cloud VM?
I have a small Spring Boot application deployed on Google cloud VM.我在 Google 云虚拟机上部署了一个小型 Spring 启动应用程序。 I have reserved a public IP for it.我为它保留了一个公共的 IP。 I have enabled DNS Zone, created A, CNAME records as well as I have put the provided google nameservers in GoDaddy DNS configuration.我启用了 DNS 区域,创建了 A、CNAME 记录,并将提供的谷歌名称服务器放入 GoDaddy DNS 配置中。 When I run nslookup mywebsite.com
in the terminal.当我在终端中运行nslookup mywebsite.com
时。 I am getting the correct IP address of the website.我得到了网站的正确 IP 地址。 Also, the website is accessible through IP address.此外,该网站可通过 IP 地址访问。 But I am unable to access it via domain name, ie但我无法通过域名访问它,即
http://IP_ADD:8080
: Works successfully. http://IP_ADD:8080
:工作成功。
mywebsite.com
: Doesn't work. mywebsite.com
:不起作用。 I get: www.mywebsite.com
refused to connect.我得到: www.mywebsite.com
拒绝连接。
The firewall rules in the google cloud VM instance are as follows: google云VM实例中的防火墙规则如下:
Some of the articles which I have followed: https://vinoaj.com/guides/2018/google-cloud-dns-for-godaddy-domain/我关注的一些文章: 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.请注意,您正在尝试访问www.mywebsite.com
,而您似乎在 DNS 记录中配置了mywebsite.com
。 They are not the same thing.它们不是同一件事。
Please, be sure that you configure a CNAME record for www.mywebsite.com
.请务必为www.mywebsite.com
配置 CNAME 记录。 Consider, for example, this related SO question, or this other one.例如,考虑这个相关的 SO 问题,或者另一个问题。
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
.另外,请注意,您正在端口 8080 上访问 web 应用程序。您需要某种 web 服务器、代理或服务,如负载均衡器,将流量从端口80
和/或端口443
重定向到您的应用程序正在监听的8080
。
As another useful link, you could also check Google Cloud DNS Best Practices .作为另一个有用的链接,您还可以查看Google Cloud DNS 最佳实践。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.