->AWS Management Console->Cloudfront->Distribution settings of selected Distribution
->Origins: create both origins (e.g., pointing to 2 different S3 buckets)
->Behaviors: create "path patterns" for each origin such that Cloudfront can
distinguish which origin the Cloudfront url points to. E.g., in my S3 bucket named
"tim-UNsigned-bucket" I set the path pattern to `uploads/*`. For my signed url bucket,
I gave it the more general path pattern of `*` and prioritized it 2nd.
As you can see below, this means that my unsigned url includes the path, uploads/,
whereas my signed does not.
Resulting Cloudfront url structure:
签名网址: https:// or http://blahblah.cloudfront.com/file1.jpg?Policy=asf...
未签名的网址: https:// or http://blahblah.cloudfront.com/uploads/file2.jpg
1 回答
我可以回答我自己的问题 . 是的,您可以在同一个Cloudfront发行版中拥有已签名和未签名的URL . 在下面的示例中,我的发行版称为
blahblah.cloudfront.com
. 关键是要指定两个"origin server" . 一个用于签名的URL,另一个用于未签名的URL .Resulting Cloudfront url structure:
签名网址:
https:// or http://blahblah.cloudfront.com/file1.jpg?Policy=asf...
未签名的网址:
https:// or http://blahblah.cloudfront.com/uploads/file2.jpg
Note: 进行任何这些更改都需要几分钟(5-15分钟)进行更新 . 因此,尽可能以最少的错误尽可能地在我的方向上做出所有改变,否则它将永远带你 .