1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
Try this: -Go to the CloudFront distribution.
- Navigate to the ‘Origins’ tab and create a new origin pointing to
my-s3-bucket
. -Go to the ‘Behaviors’ tab and create a new behavior (or modify the existing one for/logistics/*
) to point to the origin you created formy-s3-bucket
. - Navigate to the ‘Error Pages’ tab.
- Click on ‘Create Custom Error Response’.
- For HTTP error code, choose 404.
- For Customize Error Response, choose Yes.
- For Response Page Path, input
/index.html
. - For HTTP Response Code, choose 200: OK.
- Make sure this custom error response is associated with the
/logistics/*
behavior. By setting it up this way, when CloudFront encounters a 404 for a path under/logistics/*
, it should serve theindex.html
frommy-s3-bucket
, and the SPA's router can then handle the route client-side. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html
répondu il y a 10 mois
Contenus pertinents
- demandé il y a un jour
- demandé il y a 3 mois
- Réponse acceptéedemandé il y a 8 mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 3 ans
- AWS OFFICIELA mis à jour il y a 3 ans
- AWS OFFICIELA mis à jour il y a 2 ans