Make sure the bucket have the public ListBucket permission
YourBucket >> Permissions >> Bucket Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicListing",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::yourbucketname"
}
]
}
You can allow "*" or specific domain
YourBucket >> Permissions >> CORS configuration
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Enable / Disable required settings YourBucket >> Permissions >> Public access settings