The setup, I have videos being stored and served from S3. I also setup a cloudfront distribution to serve these same files. Now, I added the cloudfront cname to the site and the videos serve up just fine through cloudfront.
Here's the problem, when I add a pre-signed url to the config, the videos serve up from the S3 bucket URL instead of cloudfront URL. When I take the pre-signed path out of the config, the videos go back to serving from cloudfront. When the pre-signed path is setup, the urls to the videos do include the signed credentials.
I'd like the videos to serve from cloudfront and not the bucket directly.
What am I doing wrong here?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | amazons3-support_cloudfront_signed_urls-1837920-7.patch | 4.75 KB | chunty |
| #6 | amazons3-support_cloudfront_signed_urls-1837920-6.patch | 3.63 KB | pdrake |
Comments
Comment #1
joaomachado commentedI seem to be having the same issue...I have images and files under two different content types set up. I too have the a CNAME set up (cdn.mysite.com) that works fine under images but content that has files for download they are served directly from S3. If I manually change the path to cdn.mysite.com/
before the 60 seconds runs out it will download and not download after the 60 seconds. I think the first step may be to find out why the CNAME is not being changed on all certain content.
Subscribing to this one...
Comment #2
barwonhack commentedBump
Comment #3
j.branson commentedSame things is happening for me. I'm not able to get the video file to download before or after my time out though when I manually replace the url with my cloudfront address. I get the no style formatting message from S3.
This is probably in the AmazonS3StreamWrapper.inc file if I had to bet. I've had to make a few changes in that file before. I'll take a peak later but I'm not sure if I'll be able to figure it out. Any suggestions here are quite welcome!
...at the same time I will note this: videos are huge files. As long as the non-profit I work with is paying for it, I know we won't be too terribly pained if we don't have to pay between 12 to 25 cents a Gig transfered for the large amount of internally housed videos we have. Also I suppose that through cloudfront it's possible to make the whole bucket signature access. This seems like a bit silly to do and I haven't wanted to put the time in to experiment with it yet, but it is an option.
Peace
Comment #4
barwonhack commentedOkay thanks. The alternative is to just change the cloudfront domain every now and then if the content keeps getting jacked.
Comment #5
haysuess commentedI see the same thing. Luckily, I set up presigned URLs only for 1 directory, so it's fine for me, but it would be nice to have this fixed.
Comment #6
pdrake commentedThis happens because the signing code in the module currently only supports the S3 presigned urls method, not CloudFront URL signing. This patch adds support for CloudFront URL signing. Using this patch requires setting the cloudfront keypair settings on the AWS SDK UI module's configuration page.
Comment #7
chunty commentedI've extended this patch a little allow you lock down the signing a bit and use the IP address in the signed url that is generated but how do I submit this patch for review here?
Comment #8
chunty commentedI've extended this patch to include the option to use the IP address in the policy as documented here: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/privat...
Please ignore my comment at #7 asking how to upload it - I figured it out
Comment #9
justafishFixed https://github.com/justafish/amazons3/commit/4b85704fba969f46382009c20aa...
Comment #10
j.branson commentedThank you!
Comment #11
chunty commented@justafish
Have you rolled your changes into any of the versions on drupal.org or just github.
Thanks
Chris
Comment #12
justafishThey're the same repo. It's in the 1.0 release.
Comment #14
fox_01 commentedIn Version 1.0 the help message says that cloufront signed url are not supported in he help of the field torrent url
Is that just an old description or does the 1.0 not contain this patch?