Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created September 8, 2021 09:49
Show Gist options
  • Save velotiotech/82d5396ab375105c34b4c663ce6eafcd to your computer and use it in GitHub Desktop.
Save velotiotech/82d5396ab375105c34b4c663ce6eafcd to your computer and use it in GitHub Desktop.
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