Skip to content

Instantly share code, notes, and snippets.

@elnygren
Created March 20, 2017 17:31
Show Gist options
  • Save elnygren/387269e2e013195a18fda3a2fbf74527 to your computer and use it in GitHub Desktop.
Save elnygren/387269e2e013195a18fda3a2fbf74527 to your computer and use it in GitHub Desktop.
S3 Cors settings
echo "
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>http://www.example1.com</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
<CORSRule>
<AllowedOrigin>http://www.example2.com</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
</CORSRule>
</CORSConfiguration>" > the_cors
s3cmd --config doc/s3cmd2.cfg setcors ./the_cors s3://my-bucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment