I’ve recently set up S3 object storage, and I’m having a bit of an issue with CNAME and buckets. At the moment, my bucket name is domain-static
, and it works perfectly when I try to view a file at it. I want to change the URL, however, be my domain, not {bucketname}.s3.amazonaws.com
, so I’d ideally like the URLS to be static.domain.com
.
I’ve added a CNAME from static.domain.com
to domain-static.s3.amazonaws.com
, but this is causing a bit of an issue, and now when I try to find a file, it gives the error:
<Error>
<Code>NoSuchBucket</Code>
<Message>The specified bucket does not exist</Message>
<BucketName>static.domain.com</BucketName>
<RequestId>REQUESTIDHERE</RequestId>
<HostId>
ID HERE
</HostId>
</Error>
It appears that the URL is trying to locate the bucket with name static.domain.com
, when in reality, it should just be redirecting the URL to domain-static.s3.amazonaws.com
. Does anyone know what could be causing this? I’m 99% certain that my code is properly working and isn’t the thing causing any issues, so I believe this is something on Cloudflare’s end. Even if I turn off proxy via CF, the issue still persists?