当我在S3管理控制台中看到文件时,为什么AWS S3返回404? [英] Why is AWS S3 returning a 404 when I can see the file in the S3 Management Console?

查看:131
本文介绍了当我在S3管理控制台中看到文件时,为什么AWS S3返回404?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题几乎概括了我的问题.我已经使用Web界面上传了文件,可以启动index.html,但是资产文件夹中的PDF返回404.

I the title pretty much sums up my problem. I have uploaded the files using the web interface, can launch the index.html, but the PDF in an assets folder returns a 404.

服务器响应:

404 Not Found

Code: NoSuchKey
Message: The specified key does not exist.
Key: assets/PDF/piano0817.pdf
RequestId: 02770C292FC4DBFA
HostId: zSn07EPw7JngHLCdcveteFDJNKATslKDCSKkJSAhsFsbW+gfeVQwvFMu3WMcY513iwt32F/OG1c=```

我已经等待了规定的时间,但S3仍然无法提供我的PDF.我在做什么错了?

I have waited the prescribed hour but S3 will still not serve my PDF. What am I doing wrong?

推荐答案

转到S3存储桶属性->静态Web托管,并将index.html添加为错误文档.

Go to S3 bucket properties -> Static web hosting and add index.html as Error document.

在您将某些内容附加到主机URL后,它将一切都视为目录.现在,在将index.html添加为错误文档后,如果找不到所需的路径作为文件夹,它将转到index.html并重定向您的请求.

It considers everything as directory once you append something to host URL. Now after adding index.html as Error document, when it doesn't find the required path as a folder, it will go to index.html and redirect your request.

这篇关于当我在S3管理控制台中看到文件时,为什么AWS S3返回404?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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