iphone - CloudFront, S3 and CORS with video files - other files OK -
i'm struggling cloudfront , s3 add access-control-allow-origin: * headers of video files stored on s3 (for inline video on iphones - seems working everywhere else inline video working on iphones same domain, assume it's cors related).
only first file in bucket has right headers
curl -i -h "origin: https ://example.com" http://cdn.example.com/0000d723-5c73-4d71-953c-d7e29e70f17b.jpg http/1.1 200 ok content-type: application/octet-stream content-length: 80962 connection: keep-alive date: thu, 02 jun 2016 00:38:50 gmt access-control-allow-origin: https://beek.co access-control-allow-methods: access-control-max-age: 3000 access-control-allow-credentials: true x-amz-meta-md5-hash: 18692618d1f6865694f08fb2dcd12201 last-modified: wed, 15 feb 2012 03:08:14 gmt etag: "18692618d1f6865694f08fb2dcd12201" accept-ranges: bytes server: amazons3 vary: origin,access-control-request-headers,access-control-request-method age: 63 x-cache: hit cloudfront via: 1.1 284d225e590e6583c457dc0182ee6fe7.cloudfront.net (cloudfront) x-amz-cf-id: n9nmat8pwhg5bzmzqopaxulgbilr7bqd5rxodzjfpki2mfthhgzgyw==
but others don't
curl -i -h "origin: https ://beek.co" http://cdn.example.co/93bd51ac-5a8c-4c08-ac67-42ee5e596477.mp4 http/1.1 200 ok content-type: video/mp4 content-length: 44751245 connection: keep-alive date: thu, 02 jun 2016 00:40:47 gmt x-amz-meta-md5-hash: 6d64731504361705258f2b0f9023bd98 last-modified: wed, 16 mar 2016 20:29:25 gmt etag: "6d64731504361705258f2b0f9023bd98" accept-ranges: bytes server: amazons3 x-cache: miss cloudfront via: 1.1 4f2b51b0906eb4177f90fe010732e8a3.cloudfront.net (cloudfront) x-amz-cf-id: qhbt8ejonauu5oxzvvxtzc0vislxgrdbk0rbq6yrdbxs9ttd7abawa==
bucket 'example-assets'
bucket policy
{ "version": "2008-10-17", "id": "http referer policy example", "statement": [ { "sid": "readonly policy", "effect": "allow", "principal": "*", "action": "s3:getobject", "resource": "arn:aws:s3:::example-assets/*" } ] }
cors configuration is
<?xml version="1.0" encoding="utf-8"?> <corsconfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <corsrule> <allowedorigin>http://*</allowedorigin> <allowedorigin>https://*</allowedorigin> <allowedmethod>get</allowedmethod> <maxageseconds>3000</maxageseconds> <allowedheader>authorization</allowedheader> </corsrule> </corsconfiguration>
cloudfront distribution has 'origin' added whitelist settings such. i've tried adding other 2 , doesn't seem make difference.
what missing!?