Amazon S3 Redirect and Cloudfront

前端 未结 3 439
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 23:27

I\'m trying to setup 301 redirects on S3 using objects, referenced here http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html. I\'ve been having some pro

3条回答
  •  借酒劲吻你
    2020-11-29 23:58

    I had the same problem with redirects failing and zero-length files getting downloaded, but wasn't using Cloudfront.

    The root cause in my case was my DNS CNAME record pointed to the REST endpoint (static.righto.com.s3-us-west-2.amazonaws.com) instead of the website endpoint (static.righto.com.s3-website-us-west-2.amazonaws.com). Updating the CNAME record fixed my redirects.

    Another symptom of this problem was missing pages displayed an XML error page rather than an HTML error page.

    This document explains the difference between website endpoints and REST endpoints.

提交回复
热议问题