css - CORS policy for S3 bucket referencing itself -
in css files have relative paths:
.css-emoticon.smile{ background: url('../../images/sprites.png'); background-position: -16px -18px ; }
but forbidden 403 error sprite.png file when pulling s3 load on site. css file loads fine s3 onto site.
my s3 located on subdomain: http://media.example.com , site loads in files s3 http://example.com
here cors file:
<?xml version="1.0" encoding="utf-8"?> <corsconfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <corsrule> <allowedorigin>*</allowedorigin> <allowedmethod>get</allowedmethod> <maxageseconds>3000</maxageseconds> <allowedheader>content-*</allowedheader> <allowedheader>host</allowedheader> </corsrule> </corsconfiguration>
any ideas on how set cors policy allow relative urls in css?
thanks much
looks didn't set bucket policy allow access ../../images/ folder.
new bucket policy (cors looked correct)
{ "version": "2008-10-17", "statement": [ { "sid": "allowpublicread", "effect": "allow", "principal": { "aws": "*" }, "action": "s3:getobject", "resource": [ "arn:aws:s3:::media.example.com/prod", "arn:aws:s3:::media.example.com/images" ] } ] }
Comments
Post a Comment