如何在Google云存储上托管静态网站? [英] How to host a static website on google cloud storage?

查看:186
本文介绍了如何在Google云存储上托管静态网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我花了大约5天的时间在这里和Google文档上寻找答案,包括让他们的一名支持人员来帮助我.我的域仍然无法访问该网站.

So, I've spent about 5 days searching for an answer here and on Google Docs, including having one of their support people help me. My domain still doesn't resolve to the website.

记录下来,如果我使用丑陋的网址,则该网站可以正常运行( http://storage.googleapis.com/7thgradeplay.org/index.html ).

For the record, the website works if I use the ugly url (http://storage.googleapis.com/7thgradeplay.org/index.html).

几天前,我已将域转移到了Google域.

I have transferred the domain to google domains, days ago.

我已使用Google Search Console验证了域.计费已启用并正在累计.在所有文件和文件夹上都设置了Public_html.

I have verified the domain with Google Search Console. Billing is enabled and accruing. Public_html is set on all files and folders.

我正在使用Google Domains名称服务器.我没有使用Google Cloud DNS.

I am using Google Domains name servers. I am not using Google Cloud DNS.

每个Google支持: 合成记录:302将@ .7thegradeplay.org重定向到www.7thgradeplay.org 自定义资源记录:www CNAME 7thegradeplay.org

Per Google support: Synthetic Records: 302 redirect @.7thegradeplay.org to www.7thgradeplay.org Custom Resource Records: www CNAME 7thegradeplay.org

这有关系吗?存储桶名称是7thegradeplay.org.

Does this matter? storage bucket name is 7thegradeplay.org.

我认为这是我完成的所有配置.

I think that's about all the config I've done.

所有这些更改都是在星期五(3天前)完成的,当我尝试访问该网站时仍然出现404错误.我已按照说明进行操作,并尝试对以下页面进行故障排除: https://cloud.google.com/dns/troubleshooting https://cloud.google.com/storage/docs/hosting-static-网站

All of these changes were done on Friday (3 days ago), and I still get a 404 error when I try to go to the website. I have followed the instructions and tried to troubleshoot with these pages: https://cloud.google.com/dns/troubleshooting https://cloud.google.com/storage/docs/hosting-static-website

我唯一改变的是存储桶的名称.我使用了不带前导"www"的存储桶名称.请不要告诉我这就是打破它的全部.

The only thing I varied was the name of the bucket in storage. I used a bucket name without the leading 'www.' Please don't tell me this is all it takes to break it.

感谢所有帮助.

P.S.我添加了一个名为www.7thegradeplay.org的存储桶,其中包含所有相同的文件.等待了15分钟.仍然是404错误.

P.S. I added a bucket called www.7thegradeplay.org with all the same files. Waited 15 minutes. still 404 error.

P.P.S.我找到了答案,但是没有用:将Google域连接到Google Cloud斗.

P.P.S. I found an answer, but it didn't work: Connect Google domain to Google Cloud Bucket.

在PS更改有时间可以炖煮"之后,明天我将在上述PPS中重试第5步.

I will retry step #5 in the PPS above tomorrow, after the PS change has had time to 'stew'.

再次感谢您的帮助.

推荐答案

您的存储桶名称需要与URL完全匹配,因此,如果您访问的是www.7thgradeplay.org,存储桶也需要命名为www.7thgradeplay.组织.

Your bucket name needs to match the URL exactly, so if you're visiting www.7thgradeplay.org, the bucket also needs to be named www.7thgradeplay.org.

类似地,"www.7thgradeplay.org"的DNS记录必须是"c.storage.googleapis.com"的CNAME.

Similarly, the DNS record for "www.7thgradeplay.org" must be a CNAME to "c.storage.googleapis.com.".

检查DNS,我看到一个从"wwww.7thgradeplay.org"到"7thgradeplay.org"的CNAME.它必须是"c.storage.googleapis.com".如果已经设置好,则可能需要等待一段时间才能使其渗透. DNS的更新速度可能很慢.

Checking DNS, I see a CNAME from "wwww.7thgradeplay.org" to "7thgradeplay.org". It needs to be "c.storage.googleapis.com." If you've already set that, you may need to wait a while for it to percolate. DNS can be slow to update.

这篇关于如何在Google云存储上托管静态网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆