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:
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>docs/2-planning-ahead/</Key>
<RequestId>BD1AFD42A31FE849</RequestId>
<HostId>OrpCZk6Ju+sXUNwnTEMpFM34n5tndT3/NEM4Ll73zxwtFvGVjT/0+dp++GkO7bi3Ylutvr2rUPY=</HostId>
</Error>
When I manually add index.html
to the URL, the page loads. But that’s obviously not a scalable solution.
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!