CORS with Amazon S3 and CloudFront

  1. open s3 and click on bucket properties, under “permissions” section you will see “Edit CORS Configuration”
  2. open CORS Configuration and paste the following

    *
    GET
    3000
    Authorization
    Content-*
    Host
  3. save it and you are done.
  4. Here you can increase “MaxAgeSeconds” it defines the cache time in browser. Its better to have a greater value if you are serving staic files those will not change often.
  1. Open your CloudFront distribution and under “Behaviours”, click on default behaviours and edit it.
  2. Set “Forward Headers” to “whitelist”
  3. enable “Origin” from “Whitelist Headers” by moving it to right side.
  4. Save the settings and you are done with it, these settings will be reflected shorly based on the cache settings you had in S3 CORS Configuration.

The article was originally published at MicroPyramid blog.

--

--

--

Python, Django, Android and IOS, reactjs, react-native, AWS, Salesforce consulting & development company

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Different Types of Services in Kubernetes

CS371p: Week 4

How Many and How Much

@OwlHnet: SoftwareTAP for GCLOUD and AWS.

Data Engineering — Udacity Nanodegree

Monitor and optimize operational resources in SQL Server

TWiGCP — “Next OnAir is on, bare-metal Anthos, Firebase Emulator, and IAP Desktop”

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
MicroPyramid

MicroPyramid

Python, Django, Android and IOS, reactjs, react-native, AWS, Salesforce consulting & development company

More from Medium

Install MongoDB on EC2 Instance — Solved Connection Issue From Public DNS — ScanSkill

Creating a DynamoDB Table in Cloud9 Using Python & Boto3

CONNECT AWS S3 WITH NODE.JS

Setup Custom AWS lambda (λ) function dependencies using Docker containers