- Newest
- Most votes
- Most comments
Have you tried invalidating the cache in CloudFront? It's a good idea to do so before making any additions or changes to your distribution. If you tested the default path before adding the /learn/apps/translator path, then CloudFront may have cached the default UI and thus will return stale information until the cache's data is refreshed or cleared. Hope this helps out!
answered 2 years ago
The screenshot doesn't show the path pattern you've configured, but it has to have the wildcard at the end to match the prefix. The slash / at the beginning is allowed but not required; it'll work the same either way. This documentation article explains it in detail: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesPathPattern
On a general note, you shouldn't configure S3 buckets as publicly accessible and enable them for static website hosting. Instead, you should disable static website hosting for the S3 bucket, set CloudFront to use Origin Access Control to access your bucket directly as an S3 origin (and not a custom origin pointing to the s3-website hostname), and grant access in the bucket policy to the OAC you configured CloudFront to use.
Note specifically that you must disable static website hosting before configuring OAC access for it. The two features won't work together.
The procedure for configuring an S3 bucket as a native origin for CloudFront using OAC is explained in detail in documentation: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/GettingStarted.SimpleDistribution.html
Once you have that working, you should enable Block Public Access (BPA) for the bucket: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html. If no other buckets in the account are accessed publicly, you should also enable the BPA setting at the account level.
the path does have a prefix - but the linked you provided definitely helped I know I am not suppose to make s3 public, I have done that to simplify things and make the path pattern fix but those resources are great and I do need them. however, I am not sure why, I will investigate further but from this link: https://catalog.us-east-1.prod.workshops.aws/workshops/4557215e-2a5c-4522-a69b-8d058aba088c/en-US/basic-configuration/create-multiple-origins after I set AllViewerExceptHostHeader as Origin request policy for that specific path it started working. I am going to play around and read more and will post my findings.
Relevant content
asked 3 years ago
asked 2 years ago
- AWS OFFICIALUpdated 2 years ago

I didn't know about the invalidation function so I am issuing invalidations on each path change - I ran an invalidation to path
/*hopefully that works. but I disabled caching for all origins, anyways this is great info thank you!