简体   繁体   English

如何访问部署在谷歌云虚拟机上的网站?

[英]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.

相关问题 如何访问在谷歌云平台上创建的虚拟机 - How to access VM created on google cloud platform 如何访问Google Cloud / app引擎上部署的Rest Apis - how to Access rest Apis deployed on google cloud /app engine 如何在 Google Cloud VM 上运行 Java 文件? - How to run Java file on Google Cloud VM? 一个授权身份验证的网站用户(App Engine标准)如何授予对Google Cloud Storage存储桶的访问权限? - How does one grant authenticated website users (App Engine standard) access to Google Cloud Storage bucket? 如何获取Google Cloud Storage的访问代码? - How to get Access Code for Google Cloud Storage? 部署后的Google App Engine和Cloud SQL - Google App Engine and Cloud SQL when deployed Google App Engine /托管的VM云端点 - Google App Engine/Managed VM Cloud Endpoints 如果我们已在Google Cloud Platform中部署Spring Boot应用程序,如何查看日志? - How to see the logs if we have deployed our Spring Boot Application in Google Cloud Platform? 如果我已经有一个.jar可执行文件,如何使用谷歌云虚拟机实例作为服务器? - How to use a google cloud VM instance as a server, provided I already have a .jar executable? 从Google托管VM(自定义/ Java)连接到Google Cloud Datastore? - Connect to Google Cloud Datastore from Google Managed VM (Custom/Java)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM