I am following this to generate a presigned URL for download:
It does work as I receive a URL, but it has the DO domain. The format is like this: <region>.digitaloceanspaces.com/<space-name><filename><tokens>
According to the above mentioned Documentation, I can also use my custom (sub)domain.
…then modify the hostname in the URL to be the CDN hostname (<space-name>.<region>.cdn.digitaloceanspaces.com, unless the Space uses a custom hostname).
But If I change the URL to this: “MySubodmain.MyDomain.com/<filename><tokens>” it will throw a “SignatureDoesNotMatch”.
I do have the CNAME on my subdomain correctly setup as I can view non-signed urls without any problem.
As a sidenode: Besides above, the format that the Signed URL comes back is NOT as mentioned in the documentation. The Documention says this: <space-name>.<region>.cdn.digitaloceanspaces.com But it comes like this <region>.digitaloceanspaces.com/<space-name>
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Click below to sign up and get $200 of credit to try our products over 60 days!
Left an answer on this similar question that might be helpful! https://www.digitalocean.com/community/questions/setting-up-pre-signed-urls-with-custom-domain-name-and-cdn-in-php?comment=191224