使用s3_website gem在S3主机上使用react应用程序破坏路由

po5*_*o5i 3 amazon-s3 reactjs

我正在使用S3_website gem将反应构建推送到我的桶.一切都很好但是当我导航到自定义URL并且我点击刷新时,我得到404错误,因为它试图在桶中找到这个对象而不是执行路由.

我在s3_website yml中有默认配置,没有重定向规则.

site: dist
index_document: index.html
error_document: error.html
s3_endpoint: us-east-2
cloudfront_wildcard_invalidation: true
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我缺少什么配置?

Pan*_*her 8

在您的存储桶属性下,Error Document只使用与Index Document您应该使用的文件相同的文件index.html