大网数据广告活动
服务器运维问答

Unable to access GCP Compute Engine VM via domain name

· 52CE 我爱测

I'm evaluating Google Cloud Platform to see if I can build a network of applications I need for a project I plan on starting really soon. So far I have the Compute Engine API enabled on my GCP project and a VM instance set up whi…

问题原文

原帖链接 · dokgu · CC BY-SA 4.0

I'm evaluating Google Cloud Platform to see if I can build a network of applications I need for a project I plan on starting really soon. So far I have the Compute Engine API enabled on my GCP project and a VM instance set up which has Apache installed and ready to serve web pages.

Right now I can only access it through the external IP address. I want to be able to access this VM through a domain name I purchased through Google Domains.

I followed this guide to set up domain names, static IPs, DNS configurations, zones, etc.

At the end of the guide, it gives me instructions on how to verify that my setup is working correctly and I've done all of the steps mentioned in the guide (assuming my domain is domain.com):

dig +trace domain.com

or

nslookup domain.com

Both of those show the external IP address but when I type the domain name on my browser, it doesn't get resolved to that IP address and I don't see the contents of my VM's web server.

I also went to check for DNS trails and entered the domain name, and it does show the correct records.


I'm still looking around for guides and maybe I should have gone with this: https://cloud.google.com/compute/docs/instances/custom-hostname-vm - when I created my VM instance, I didn't set up a hostname for it, could it be because of that?


GCP firewall settings:

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

You bought a .dev domain so you need to have incoming traffic on https (TCP port 443). This domain (and several others) have HSTS enabled for the entire TLD and so require the use of https.

Your GCP firewall shows you have an allow rule for this traffic but only for VMs tagged https-server. Your VM did not have this tag, so giving it this tag will allow port 443 inbound.

At this point you need to set up your web server with a TLS certificate and to answer TLS requests on port 443.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-08-30)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。