I would like to setup my S3 bucket to rewrite the path of the route /api to a API Gateway URL.
So take the following:
- User goes to website bacon.com
- Website goes from Cloudflare DNS to S3 bucket
- Website is a react app
- React app makes a call to api which is
bacon.com/api - S3 rewrites
/apipath to api gateway urlhttps://ljsdflkjlsdk.execute-api.us-east-1.amazonaws.com/dev
I was able to get this to work here:
however, it forwards the URL to that API gateway URL which is not desired.
I'm not entirely sure this is possible. I'm thinking it might require either me implementing something like Route53 or writing a cloudflare worker to handle the rewrite?
Thanks in advance for your help!

