I deployed a NextJS app on AWS S3. I followed this article https://netosec.com/deploying-static-react-nextjs-to-aws-s3/ to set things up. When I open my site I have to type index.html to get the page open. I can probably fix this by adding trailingSlash:true in the nextjs config but that's not the main issue. I am able to browse the site by clicking various links on the page. But, if I refresh the page I get the S3 accessdenied error:
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
I have been trying to figure out why this is happening but I have not been able to fix this. Any advice?