I am trying to integrate S3 bucket as the remote storage source for media on my magento project hosted on Magento cloud with Fastly enabled. I've followed this doc for enabling remote storage and this doc for setting up VCL on fastly from Magento cloud admin panel on staging instance.
I'm trying to configure Fastly to act as a reverse proxy and fetch all php related scripts from Magento origin and any media/image related resource directly from S3 instead of sending request to Magento and cache it so it can be returned directly from Fastly the next time user calls it.
Lets say my bucket url is https://staging-bucket.s3.us-east-1.amazonaws.com/ so as soon as i upload the VCL snippet from magento backend, i get the following error on every page
{"status":502,"message":"No route known for staging-bucket.s3.us-east-1.amazonaws.com"}
what am i doing wrong or what step could i be missing?
- Tried adding the S3 url as hostname from Magento admin panel
- Tried creating backend for S3 as origin for Magento
- Making S3 bucket publicly accessible for any permission or access related issue
- Enabled CORS on S3 bucket