Why doesn't react's BrowserRouter work on cloudfront when s3 oai settings are applied?

0

BrowserRouter was used to implement the react webpage spa in s3.

When I set it to public, it worked fine. However, when accessing from cloudfront after applying public access deny and oai, it did not work. So I used HashRouter and it worked.

My guess is that s3 only supports static webpages, so browserRouter doesn't work, only HashRouter works. However, when set to public, BrowserRouter worked.

If I apply the oai setting to s3, why doesn't react's BrowserRouter work on cloudfront?

1개 답변
0

This Stackoverflow link might be addressing this issue https://stackoverflow.com/questions/51218979/react-router-doesnt-work-in-aws-s3-bucket For steps about how to use BrowserRouter with S3 and CloudFront, refer to this external link https://aws.plainenglish.io/how-to-deploy-react-app-with-s3-and-cloudfront-6d170172cd58

AWS
답변함 2년 전
  • This is a temporary measure to fix the error, so I don't think it's a fundamental solution. And I asked why the browser router is not working.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠