Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
638 views
in Technique[技术] by (71.8m points)

amazon web services - cloudfront s3 gives cors issue for dynamic origin

Getting cors issue for multiple clients domains

i have kept images on S3 and are consumed by multiple clients domains through single Cloudfront url

Note - Cloudfront is having only 1 domain name https://www.stati.. and so that i don't have to mention each clients domain name everywhere we have mentioned "AllowedOrigins": ["*"] on s3

S3 configuration

{
    "AllowedHeaders": ["*"],
    "AllowedMethods": ["GET"],
    "AllowedOrigins": ["*"],
    "ExposeHeaders": [],
    "MaxAgeSeconds": 3000
}

Cloudfront Configuration

https://aws.amazon.com/premiumsupport/knowledge-center/no-access-control-allow-origin-error/

enter image description here

enter image description here

enter image description here

enter image description here

Note :

  • invalidated caches after all config changes
  • tested on different clear cache on incognito browsers
question from:https://stackoverflow.com/questions/65843930/cloudfront-s3-gives-cors-issue-for-dynamic-origin

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...