Hi bep. I am working with AWS support on this currently. You’re right that an ‘implied index.html’ works fine with CloudFront when the distribution is configured to sit in front of an S3 static website endpoint. In that mode, S3 is acting as a webserver which can do this. But switch to using a OAI directly, as documented at https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html, and a hugo-generated site breaks hard.
Here’s a AWS blog post showing a lambda hack to get around this issue: https://aws.amazon.com/blogs/compute/implementing-default-directory-indexes-in-amazon-s3-backed-amazon-cloudfront-origins-using-lambdaedge/
I would very much prefer not to use compute to simply rewrite requests to specify index.html.
Any other users out there know how to get around this? Perhaps there’s a config I’m doing wrong on AWS? If yes I would hope/assume the AWS CloudFront guy I’m working with would know about it; I’m suspecting not.
Regardless, it would be just fantastic if Hugo had a rendering option whereby the full URL including index.html were always emitted, and we never had to rely on this website feature of serving an implied url.
Is this possible in Hugo, while still rendering relative URLs?
Any other suggestions from the field?