NextJs Pre-rendered Project Deployment On S3 Without Making S3 Public

Job ID: 33686884

Budget: ₹750 – ₹1,250 INR

Hi,

I have a website which is pre-rendered/pre-build using Next Js. When it's pre-rendered, it has files such as
/index.html
/about-us/index.html

I have setup s3 with cloudfront.

Now when I hit the cloudfront url as root, the website gets loaded, but when I do with domain.com/about-us/, it gives a 403 (permission denied) error.

Can anyone help?
Related categories: DevOps Amazon S3 Amazon CloudFront