Cloudfront 使用 307 临时重定向重定向到 S3 端点
Cloudfront redirecting to S3 endpoint with 307 Temporary Redirect
我正在使用 307 Temporary Redirect
将云端端点重定向到 S3。发生这种情况是否有原因?
我已经尝试创建网站端点并更改来源,但没有成功,结果相同。
Temporary Request Redirection
这实际上是由 S3 存储桶在新创建时的行为方式引起的(感谢 @Michael-sqlbot)澄清了这一点。
来自 docs(临时请求重定向)
Due to the distributed nature of Amazon S3, requests can be temporarily routed to the wrong facility. This is most likely to occur immediately after buckets are created or deleted. For example, if you create a new bucket and immediately make a request to the bucket, you might receive a temporary redirect, depending on the location constraint of the bucket.
根据 docs 将您的源域名更改为 bucketname.s3-region.amazonaws.com:
If you're using an Amazon CloudFront distribution with an Amazon S3 origin, CloudFront forwards requests to the default S3 endpoint (s3.amazonaws.com), which is in the us-east-1 Region. If you must access Amazon S3 within the first 24 hours of creating the bucket, you can change the Origin Domain Name of the distribution to include the regional endpoint of the bucket. For example, if the bucket is in us-west-2, you can change the Origin Domain Name from bucketname.s3.amazonaws.com to bucketname.s3-us-west-2.amazonaws.com.
我正在使用 307 Temporary Redirect
将云端端点重定向到 S3。发生这种情况是否有原因?
我已经尝试创建网站端点并更改来源,但没有成功,结果相同。
Temporary Request Redirection
这实际上是由 S3 存储桶在新创建时的行为方式引起的(感谢 @Michael-sqlbot)澄清了这一点。
来自 docs(临时请求重定向)
Due to the distributed nature of Amazon S3, requests can be temporarily routed to the wrong facility. This is most likely to occur immediately after buckets are created or deleted. For example, if you create a new bucket and immediately make a request to the bucket, you might receive a temporary redirect, depending on the location constraint of the bucket.
根据 docs 将您的源域名更改为 bucketname.s3-region.amazonaws.com:
If you're using an Amazon CloudFront distribution with an Amazon S3 origin, CloudFront forwards requests to the default S3 endpoint (s3.amazonaws.com), which is in the us-east-1 Region. If you must access Amazon S3 within the first 24 hours of creating the bucket, you can change the Origin Domain Name of the distribution to include the regional endpoint of the bucket. For example, if the bucket is in us-west-2, you can change the Origin Domain Name from bucketname.s3.amazonaws.com to bucketname.s3-us-west-2.amazonaws.com.