I have a Cloudfront distribution setup in front of an S3 bucket.
My folder structure in this bucket is something like:
index.html
page1
- index.html
page2
- index.html
Now if I visit the site through the standard S3 static website endpoint everything works. I start on / and can click on links that refer to /page1/ and everything loads correctly.
But if I access it through the cloudfront distribution then I get access denied for all accesses like /page1/ -> if I manually type in /page1/index.html it works though.
My problem is that my website is statically generated and I cannot change the links to refer to /page1/index.html instead of /page1/
How do I allow these directory level accesses via cloudfront?