custom 404 page for missing object in s3 temporary signed URL

ぐ巨炮叔叔 提交于 2019-12-08 08:45:02

问题


I am generating some signed URL's for some private information in Amazon S3

In the case that the signed link has expired, or that the object doesn't exist there is an XML error that is reported, along with a 404 error (or 403 forbidden).

Is it possible to redirect the signed link 404 to a custom error page? This seems different to the 404 error page for the S3 static website settings.

My research so far has indicated that if you use the static pages, the permissions have to be publicly readable for all content and you cannot generate the signed URL (or I'm doing it wrong) OR if you use a signed URL the 404 error doesn't redirect and you just get the XML error.

all the links i have found point to use the static pages but I don't think that applies in this case.


回答1:


It is possible that what you want is this: In the Developer guide there is a paragraph about "Custom Error Document Support" where I read the following sentence.

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/custom-404-page-for-missing-object-in-s3-temporary-signed-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!