Spaces CDN returns SignatureDoesNotMatch
Hi! I’m successfully using DO Spaces with an Elixir libarary to build presigned urls:
signed_url = AWSAuth.sign_url( @access_key, @secret_key, "get", "https://mybucket.ams3.digitaloceanspaces.com/mybucket/0342cfce-f037-49c6-976f-97b2b8ec6f19.pdf", "ams3", "s3" )
This works fine, but I want to use the CDN to speed up the requests. I tried to add
.cdn to the URL:
signed_url = AWSAuth.sign_url( # ... "https://mybucket.ams3.cdn.digitaloceanspaces.com/mybucket/0342cfce-f037-49c6-976f-97b2b8ec6f19.pdf", # ... )
However, this doesn’t work – I always get the following error:
<Error> <Code>SignatureDoesNotMatch</Code> <RequestId>tx000000000000049363e85-005bfd730a-b8ca18-ams3a</RequestId> <HostId>b8ca18-ams3a-ams3</HostId> </Error>
I also tried signing the URL without
.cdn and just accessing it with
.cdn, but got the same error. What am I doing wrong?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.