gpt4 book ai didi

amazon-s3 - ListBucketResult xml 试图通过 CloudFront 在 S3 中显示站点的主页

转载 作者:行者123 更新时间:2023-12-04 13:10:34 30 4
gpt4 key购买 nike

我创建了一个存储桶,用于托管我的静态网站。

我将属性设置为将其用作静态网站托管(索引文档值 index.html)

网址是:http://mywebsitelearningcurve.s3-website-us-east-1.amazonaws.com (暂时没有,只是为了解释)

我将其公开(许可)。

我的存储桶概览

/images
/static
/asset-manifest.json
/favicon.ico
/index.html
/manifest.json
/service-worker.js

使用 http://mywebsitelearningcurve.s3-website-us-east-1.amazonaws.com我可以访问我的网站。但是我决定在我的存储桶前使用 CloudFront。

我为 WEB 创建了一个新的发行版。

在原始域名上,我使用了 mywebsitelearningcurve.s3.amazonaws.com

来源 ID:S3-mywebsitelearningcurve

在查看器协议(protocol)策略中,我选择了:将 HTTP 重定向到 HTTPS。

一旦它完成并且我等待了一个谨慎的时间来传播,我就有了网址 https://d2qf2r44tssakh.cloudfront.net/ (目前没有,只是为了解释)。

问题:
当我尝试使用 https://d2qf2r44tssakh.cloudfront.net/它向我展示了一个 xml
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>mywebsitelearningcurve</Name>
...
...
...
</ListBucketResult>

但是,当我尝试 https://d2qf2r44tssakh.cloudfront.net/index.html它工作正常。

我经历了几个 tutos 并发布,但我仍然无法让它工作。任何人都可以提供帮助吗?
谢谢

最佳答案

我今天遇到了同样的问题,可以通过添加 index.html 来解决它到默认根对象 在分发设置中:

enter image description here

Optional. The object that you want CloudFront to return (for example, index.html) when a viewer request points to your root URL (http://www.example.com) instead of to a specific object in your distribution (http://www.example.com/index.html).

关于amazon-s3 - ListBucketResult xml 试图通过 CloudFront 在 S3 中显示站点的主页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50892335/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com