Issue
At the moment I'm hosting a bundled Angular-2
App in an AWS S3 bucket
, so it only contains .html
and .js
files.
The absolute path http://example.com/
does work but if I switch to any links, such as http://example.com/testsite
it returns 404 error
as below:
404 Not Found
Code: NoSuchKey
Message: The specified key does not exist.
Key: voucher
RequestId: 7A08F32C18D3C6D3
HostId: 6jTd5D5QDU+AP4vo+uRcHHVT5WeRAKjoPeqVb39xoKZZSvWWz/9TsNp41TbuKXmtpYbLZJiyqwE=
I already tried another bucket policy and I set every file to public, but it won't work for me.
Anyone has a solution? Please help.
Solution
Your bucket policy Resource property needs to contain, note the /*:
"Resource":["arn:aws:s3:::bucketname/*"]
You also need to set the error document to be your index.html
Answered By - David Findlay
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.