简体   繁体   English

如何在地址中没有 storage.googleapis.com 的情况下查看我的静态网站

[英]How to view my static website without storage.googleapis.com in the address

I am trying to build my first website on a domain that I purchased through Google Domains.我正在尝试在我通过 Google Domains 购买的域上构建我的第一个网站。 I have followed this tutorial but am still unable to reach my site by visiting www.mysite.com我已遵循本教程,但仍然无法通过访问www.mysite.com访问我的网站

I have ensured that index.html and 404.html are set to public-read and I can see them by clicking on the public link button in the console, but that takes me to https://storage.googleapis.com/www.mysite.com/index.html我已确保将index.html404.html设置为公开读取,我可以通过单击控制台中的公共链接按钮来查看它们,但这会将我带到https://storage.googleapis.com/www。 mysite.com/index.html

I want to simply be able to type www.mysite.com and see my index.html document.我只想能够输入www.mysite.com并查看我的 index.html 文档。

I have added a record set with DNS Name www.mysite.com and Data c.storage.googleapis.com but still have no luck.我添加了一个带有DNS Name www.mysite.comData c.storage.googleapis.com的记录集,但仍然没有运气。

What am I missing?我错过了什么?

UPDATE更新

This tool shared by a commenter below shed a bit more light on what seems to be causing the issue.下面的评论者分享的这个工具更清楚地说明了导致问题的原因。 It looks like my registrar setup is not finished, but I am not sure how to do so.看起来我的注册商设置还没有完成,但我不知道该怎么做。

I noticed that when I search for www.mysite.com, every field says No record found , but when I search for just mysite.com (no "www"), some fields are populated (not AAAA, CNAME, A, SPF, SRV, TXT, SRV, or LOC, though)我注意到,当我搜索 www.mysite.com 时,每个字段都显示No record found ,但是当我只搜索 mysite.com(没有“www”)时,会填充一些字段(不是 AAAA、CNAME、A、SPF,不过,SRV、TXT、SRV 或 LOC)

I also noticed the "Registrar Setup" link on the Cloud DNS page, which says "This zone will not normally be usable until you register the related domain and configure these records with your registrar:" and lists ns-cloud-e1.googledomains.com for e1 through e4.我还注意到 Cloud DNS 页面上的“注册商设置”链接,上面写着“在您注册相关域并使用注册商配置这些记录之前,此区域通常无法使用:”并列出了ns-cloud-e1.googledomains.com e1 到 e4 的ns-cloud-e1.googledomains.com

Why are fewer fields populated for www.mysite.com than for mysite.com, and what steps do I need to take to finish my registrar setup?为什么 www.mysite.com 填充的字段少于 mysite.com,我需要采取哪些步骤来完成我的注册商设置?

UPDATE: ANSWERED更新:回答

I determined the issue and have posted the answer below我确定了这个问题并在下面发布了答案

What error do you get exactly when you go to www.mysite.com?当您访问 www.mysite.com 时,您会遇到什么错误? Does it resolve?能解决吗? Do you get a 404?你有404吗? Do you get the 404 you specified?你得到你指定的 404 了吗? Or a 404 from Google?还是来自 Google 的 404? Or something else?或者是其他东西?

Are you sure the CNAME is set correctly?您确定 CNAME 设置正确吗? You can check it with a tool like this: https://www.ultratools.com/tools/dnsLookup您可以使用这样的工具进行检查: https : //www.ultratools.com/tools/dnsLookup

What happens when you go to www.mysite.com/index.html ?当您访问 www.mysite.com/index.html 时会发生什么? Did you assign pages?你分配页面了吗? https://cloud.google.com/storage/docs/hosting-static-website#optional_assigning_pages https://cloud.google.com/storage/docs/hosting-static-website#optional_assigning_pages

I found the issue: I had added my CNAME entry on the Cloud Console > Cloud DNS page, rather than on my Google Domains registry.我发现了问题:我在 Cloud Console > Cloud DNS 页面上添加了我的 CNAME 条目,而不是在我的 Google Domains 注册表中。 After removing the entry from the Cloud DNS page and adding it to the Google Domains Configure DNS page, my site is up and running.从 Cloud DNS 页面中删除条目并将其添加到 Google Domains 配置 DNS 页面后,我的站点已启动并运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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