3 Answers
- Newest
- Most votes
- Most comments
0
Hello.
Is the target file located in the CloudFront origin?
For example, if you access it like "https://example.com/app/test.html", I think the S3 path needs to be like app/test.html.
https://repost.aws/knowledge-center/cloudfront-troubleshoot-404-errors
0
I have all of the files like index.html in root of the bucket. Within the root - I have assets folder which has js files. Origin path is cloudfront distribution is set to empty.
answered 2 years ago
0
I even tried using API gateway and setting /app to my cloudfront URL but the same issue. All assets throw 404 error. Is there anything to do with cloudfront?
answered 2 years ago
Relevant content
asked 2 years ago
asked 2 years ago

If the file is in the root folder of the S3 bucket, try adding "/" to the end of the "proxy_pass" URL.
CloudFront passes the URL unchanged to your origin. Therefore, a URL like "/app/test.html" will behave like opening "/app/test.html" in the S3 bucket.
How do I rewrite the URL to match the origin settings?