Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created September 8, 2021 09:49
Embed
What would you like to do?
PUBLIC_URL=https://{your-static-bucket-name}.s3.{aws_region}.amazonaws.com/ npm run build
//Bucket Policy
{
"Version": "2012-10-17",
"Id": "http referer from your domain only",
"Statement": [
{
"Sid": "Allow get requests originating from",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::{your-static-bucket-name}/static/*",
"Condition": {
"StringLike": {
"aws:Referer": [
"https://your-app-domain-name"
]
}
}
}
]
}
//CORS
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"https://your-app-domain-name"
],
"ExposeHeaders": []
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment