With this bucket policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::mypage.com/*"
}
]
}
I am deploying a website that is build by reactJS v16+ (react-router-dom v5), and when I open the url, it works perfectly, e.g. from mypage.com, the that goes to /list works fine. Url is loaded as mypage.com/list and the page content is displayed.
However on any child page that is not homepage, for example mypage.com/list, once I refresh the page with browser, it returns S3's 404:
404 Not Found
Code: NoSuchKey
Message: The specified key does not exist.
Key: list
I don't even know how to debug this... any idea?