po5i
po5i

Reputation: 558

Broken routes with react app on S3 hosting using s3_website gem

I am using S3_website gem to push a react build to my bucket. Everything works great but when I navigate to a custom url and I hit refresh, I get a 404 error because it tries to find this object in the bucket instead of executing the route.

I have the default config in the s3_website yml with no redirect rules.

site: dist
index_document: index.html
error_document: error.html
s3_endpoint: us-east-2
cloudfront_wildcard_invalidation: true

enter image description here

What configuration I am missing?

Upvotes: 3

Views: 734

Answers (1)

Panther
Panther

Reputation: 9418

In your bucket properties under Error Document just use the same file as the Index Document which should be your index.html

Upvotes: 8

Related Questions