NoSuchBucket error - cloudflare images subdomain not working with S3 bucket

What is the name of the domain?

images

What is the error number?

404

What is the issue you’re encountering

NoSuchBucket error - cloudflare images subdomain not working with S3 bucket

What feature, service or problem is this related to?

DNS records

What are the steps to reproduce the issue?

I have configured this CNAME record in cloudflare with proxy enabled
CNAME - images - mydomain.s3-website-us-west-2.amazonaws.com

But when I try accessing http://images.mydomain.com/cf/landing-page/abc.png, I get below error
404 Not Found
Code: NoSuchBucket
Message: The specified bucket does not exist
BucketName: images mydomain com

At the same time I am able to access the image directly form S3

Basically we would like our S3 images to be served on images subdomain through cloudflare

A CNAME record just points to the same IP as the destination. Ordinarily, Amazon S3 will require that the hostname you are serving from matches the bucket name. i.e. in this case the bucket would have to be called images.mydomain.com exactly. Not sure how this works for s3-website though.

Luckily, Cloudflare recently released a neat feature that allows you to link buckets without that mess:

Head to https://dash.cloudflare.com/?to=/:account/:zone/rules/cloud-connector and you should be able to select “Amazon S3” and then enter your bucket domain:

Then match it on the images subdomain like so:

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.