Skip to content

Instantly share code, notes, and snippets.

@ScottPhillips
Created May 23, 2012 01:57
Show Gist options
  • Save ScottPhillips/2772821 to your computer and use it in GitHub Desktop.
Save ScottPhillips/2772821 to your computer and use it in GitHub Desktop.
Amazon S3 Bucket Policy : Restrict Access to Specific Referer
{
"Version":"2008-10-17",
"Id":"http referer policy example",
"Statement":[
{
"Sid":"Allow get requests referred by www.mysite.com and mysite.com",
"Effect":"Allow",
"Principal":"*",
"Action":"s3:GetObject",
"Resource":"arn:aws:s3:::YOUR_S3_BUCKET_NAME/*",
"Condition":{
"StringLike":{
"aws:Referer":[
" http://www.mysite.com/*",
" http://mysite.com/*"
]
}
}
}
]
}
@TyVik
Copy link

TyVik commented Oct 19, 2016

Thanks a lot! It`s very useful example, but could you please remove space character before allowed domains?

@Haverdessis56
Copy link

Thanks for giving a practical and easy-to-understand example. I want to create a basket random game, how should I do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment