- Newest
- Most votes
- Most comments
Any luck on trying invalidating the cache in CloudFront, below some reference:
https://github.com/aws-amplify/amplify-hosting/issues/1058
https://stackoverflow.com/questions/65860738/error-403-while-building-the-app-in-aws-amplify
Hey,
Hope you're keeping well.
Intermittent 403s from Amplify rewrites usually point to CloudFront caching of an error response or an origin mismatch. When you rewrite /v2/* requests to another Amplify app, CloudFront still enforces origin access, so if the secondary app’s domain isn’t correctly mapped to the same CloudFront distribution or doesn’t have that path allowed, you’ll get 403s. Try running a full cache invalidation in the Amplify console under Hosting > App settings > Clear cache to ensure stale 403s aren’t being served. Also verify the rewrite target is using its own build’s `index.
Thanks and regards,
Taz
answered 10 months ago
Relevant content
asked a year ago
asked 3 years ago

This issue occurs randomly when we refresh the page. Sometimes, we get an error, but if we refresh again, it works fine. It happens frequently and is not related to the build process — it occurs after the app is deployed and accessed.