AWS S3"404未找到"; [英] AWS S3 "404 Not Found"

查看:565
本文介绍了AWS S3"404未找到";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在将一个内置的Angular 2应用托管在S3存储桶中, 因此它只包含.html.js文件.

At the moment im hosting an builded Angular 2 App in an S3 buckets, so it only contains .html and .js files.

绝对路径http://example.com/确实可以工作,但是如果我切换到任何链接,例如http://example.com/testsite,它会向我显示以下错误.

The asolut path http://example.com/ does work but if i switch to any links, such as http://example.com/testsite it shows me the following error.

404 Not Found

 Code: NoSuchKey
 Message: The specified key does not exist.
 Key: voucher
 RequestId: 7A08F32C18D3C6D3
 HostId: 6jTd5D5QDU+AP4vo+uRcHHVT5WeRAKjoPeqVb39xoKZZSvWWz/9TsNp41TbuKXmtpYbLZJiyqwE=

我已经尝试了另一个存储桶策略,并且将evry文件设置为公开,但是对我来说不起作用.

i already tried annother bucket policy and i set evry file to public, but it wont work for me.

推荐答案

您的存储桶策略资源"属性需要包含,请注意/*:

Your bucket policy Resource property needs to contain, note the /*:

"Resource":["arn:aws:s3:::bucketname/*"]

您还需要将错误文档设置为index.html

You also need to set the error document to be your index.html

这篇关于AWS S3"404未找到";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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