Index.html pages in S3 bucket aren't loading through CloudFront distribution

I’m hosting my Hugo site in an S3 bucket behind a CloudFront distribution. I’m using the Mainroad theme. The problem is that, while the home index.html page loads, the other pages don’t. I get this error:

<Message>The specified key does not exist.</Message>

When I manually add index.html to the URL, the page loads. But that’s obviously not a scalable solution. :slight_smile:
I know the CloudFront distribution is configured correctly, because it works for the older version of the website that was written in plain HTML5. I’m also pretty sure that it’s not an S3 permissions problem, because those settings using the same Hugo site work perfectly when I push it to a test bucket that’s not served by a CloudFront distro.
Any ideas?
Thanks again!

Never mind. A bit more research revealed that I should have using the static site’s bucket’s website endpoint URL (as displayed in the S3 Properties page) as the CloudFront origin rather than the AWS ARN suggested by CloudFront that was automatically populated. See this Reddit.
Sorry about that!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.