开发者

specifying a 30s ACL not working with Cloudfront?

开发者 https://www.devze.com 2023-02-27 01:40 出处:网络
Using the PHP Amazon SDK I am successfully able to set a 30 second access for a URL using the following functin:get_object_url($bucket, $filename, $preauth = 0, $opt = null)

Using the PHP Amazon SDK I am successfully able to set a 30 second access for a URL using the following functin: get_object_url($bucket, $filename, $preauth = 0, $opt = null)

$s3->get_object_url($results['s3.bucket.name'], $results['s3.file.name'], '30 seconds');

Now, the issue with this is that it returns a fantastic URL:

"s3.url": "http://THECOOLEST.BUCKET.INTHEWORLD.EVER.开发者_运维技巧s3.amazonaws.com/2011/04/18/image/png/8ba2d302-a441-45d4-8354-08e2b7e1a325.png?AWSAccessKeyId=XXXXXXXXXXXXXXXXX&Expires=1303162244&Signature=AWdUnHSaIBDmRcbwo2RFSUQaqBM%3D",

When I change the URL to the CNAME we use for cloudfront, the ACL doesn't work. Anyone know how to get_object_url with the CNAME configured?


Cloudfront and S3 are two different things.

You need to setup a CNAME for your S3 bucket. See the AWS docs for more info: http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?VirtualHosting.html#VirtualHostingCustomURLs

0

精彩评论

暂无评论...
验证码 换一张
取 消