amazon-s3 - s3 临时签名 URL 中缺少对象的自定义 404 页面

我正在为 Amazon S3 中的一些私有(private)信息生成一些签名 URL

如果签名链接已过期,或者对象不存在,则会报告 XML 错误以及 404 错误(或 403 禁止)。

是否可以将签名链接 404 重定向到自定义错误页面?这似乎与 S3 静态网站设置的 404 错误页面不同。

到目前为止,我的研究表明,如果您使用静态页面,则所有内容的权限必须是公开可读的,并且您无法生成签名 URL(或者我做错了)或者如果您使用签名 URL 404 错误不会重定向,您只会收到 XML 错误。

我找到的所有链接都指向使用静态页面,但我认为这不适用于这种情况。

最佳答案

你想要的可能是这样的: 在Developer guide有一段关于“自定义错误文档支持”的段落,我在其中阅读了以下句子。

You can optionally provide a custom error document with a user-friendly error message and with additional help. You provide this custom error document as part of adding website configuration to your bucket. Amazon S3 returns your custom error document for only the HTTP 4XX class of error codes.

https://stackoverflow.com/questions/16329130/

相关文章:

arrays - 重命名 MongoDB 数组中嵌入文档中的字段不起作用

php - 为什么使用 mPDF 合并 PDF 文件后超链接丢失?

python - 在python多处理中实现Ctrl+C取消

node.js - Mongo降序排序

asp.net-mvc-4 - Razor 看不到我的右括号

vbscript - 带参数的 Shell.Run

visual-studio-2012 - Visual Studio : Undo-redo of

c# - 在 C#/.NET 中逐笔更新到烛台/OHLC 数据

json - Play 2.1(scala) - 如何为 scala 枚举案例类编写 Format[

image - 通过 mongo shell 脚本将图像文件读入 MongoDB 文档的二进制字段