Getting CORS error in AWS (Cloudfront distribution + S3 setup)

  Kiến thức lập trình

Earlier I was accessing this cloudfront distribution from one repo, localhost:4000, and from stage env. It was all working fine. I sat up a new localhost localhost:4800 and tried accessing the same cloudfront distribution, but I am getting CORS error.
Below are the CORS setting in the S3 bucket and Origins and Behaviors setting in the Cloudfront.

There is no Origin request policy or Response headers policy added.
I have invalidated the cache with ‘/*’ object path, many times.

I am getting different response header, while trying to access cloudfront from the new localhost. I am getting localhost:4000, which should have been localhost:4800. Screenshot below

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT