'Getting 403 Access Denied Errors When Hosting a SSG nextjs App in AWS S3 and CloudFront
I got a nextjs app with a couple static pages in a bucket being hosted on cloudfront and I ran into an interesting error. The pages are in s3 but if I refresh on a page other than index.html, cloudfront will still throw a 403 error.
If I add an error page for index.html with a 200 response cloudfront will load the home page while nextjs keeps the current page path. Since it's statically generated I don't think it's hot reloading back to the current page, and I don't know what else I should do to fix this
cloudfront and bucket configuration

page behavior
here's the home page
About page when refreshed (it loaded the home page)

Note: I'd like to achieve this without having bucket set to public access and through an OAI, does anyone know what might be the cause?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
