aldy120 / s3-note

Note for Amazon S3
0 stars 0 forks source link

S3 Error Document #5

Open aldy120 opened 4 years ago

aldy120 commented 4 years ago

website endpoint

如果找不到就會幫你加個斜線試試看

https://docs.aws.amazon.com/AmazonS3/latest/userguide/CustomErrorDocSupport.html When Amazon S3 receives a request for a key x, http://bucket-name.s3-website.Region.amazonaws.com/x, without a trailing slash, it first looks for the object with the key name x. If the object is not found, Amazon S3 determines that the request is for subfolder x and redirects the request by adding a slash at the end, and returns 302 Found.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/IndexDocumentSupport.html However, if you exclude the trailing slash from the preceding URL, Amazon S3 first looks for an object photos in the bucket. If the photos object is not found, it searches for an index document, photos/index.html. If that document is found, Amazon S3 returns a 302 Found message and points to the photos/ key. For subsequent requests to photos/, Amazon S3 returns photos/index.html. If the index document is not found, Amazon S3 returns an error.

只有 4xx 會回傳 error document

You can optionally provide a custom error document that contains a user-friendly error message and 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.

aldy120 commented 4 years ago

5xx 也好像可以啊,文件寫錯了嗎