Access denied for new file uploaded to Spaces when accessing via custom Subdomain and Edge URL


I have the issue that when accessing newly uploaded files via the custom subdomain or edge url for my spaces CDN, I get a access denied error. The file is fine when accessed via the Origin URL, but the edge and custom domain urls give me a XML response which says access denied. The permission is correctly set.

After issuing a purge request for that file it works.

How can I fix this?

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I ran into this issue too, I found a solution for me. I have Laravel Media Library from Spatie uploading media for me using my DO Space. I had to add a new header to media-library config under remote.extra_headers. The line I added was 'ACL' => 'public-read', and that will add the needed header/argument that DO uses to determine if the file should be public or not.

Hope this helps.

I also get a 403 access denied

user@app-w-1:~/$ tail -n 70 laravel.log
[previous exception] [object] (GuzzleHttp\\Exception\\ClientException(code: 403): Client error: `PUT` resulted in a `403 Forbidden` response:
<?xml version=\"1.0\" encoding=\"UTF-8\"?><Error><Code>SignatureDoesNotMatch</Code><RequestId>tx0000000000000198831c1-005ef2 (truncated...)
 at /home/forge/

Origin does work. Looking into way to put using origin and load using EDGE.

How is this not getting much attention? This seems to be a big issue that basically makes DO Space useless