Score:0

Getting 403 (Forbidden) when try to load an S3 file from AWS CloudFront behaviour

jp flag
tom

I have created an S3 bucket. All objects are publicly accessible.

I can access the image file via S3 url: https://S3_BUCKET_NAME.s3.eu-west-1.amazonaws.com/xyz.jpg

I can access the image file via CloudFront root url: https://CLOUDFRONT_ID.cloudfront.net/xyz.jpg

However, I can't access the image file via CloudFront URL's sub path: https://CLOUDFRONT_ID.cloudfront.net/images/xyz.jpg

I'm getting HTTP 403. I read lots of Stackoverflow pages to resolve this issue. However, I got stuck.

error page config

origin settings

list of behaviours

s3 bucket policy

vn flag
It's a bit confusing, but yeah, the "Behaviors > Path pattern" field doesn't do what you think it does. I ran into the same thing a few months back. It does not add that path to the origin, not even with a separate custom origin for that pattern.
Score:0
jp flag
tom

Solution: i had to create a folder in s3 called "images" and I moved the picture into the images folder. it works

i also replaced path pattern from "/images/" to "images/"

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.