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

Posted March 3, 2020 6.5k views
DigitalOcean Spaces


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?

  • I am getting same in case of GIF and JPG. Please share details if you solved it.

    In my case only SUBDOMAIN not working. Origin and Edge both working.

    When trying to access file via subdomain getting permission error, even i set permission as public-read.

    I tested other file format. VIDEO and MP3 working well. Only issue with JPG and GIF

    Please share if you have any solution

  • same issue with jpeg images - works at origin but gives error when edge url is accessed… Anyone here can help???

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.

Submit an Answer
8 answers

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

  • It seems the issue is mostly caused by gif image???

    • I’m getting the same with CSS and purging isn’t doing the trick. Origin is fine, edge and subdomain throw net::ERR_ABORTED 403 (Forbidden)

      I have three CSS files in the same directory, but only one is working across all three URLs.

      EDIT: Renaming the file after upload got it working. Renaming it back to the original throws 403 again.

      UPDATE: When I first created the CSS directory, I misspelled it. I renamed it and uploaded three CSS files into it. Only one worked on upload.

      I deleted the CSS directory I had just created (and renamed) and created a new CSS directory. I re-uploaded the CSS files public and fresh. Worked.

Having the same issue. It only happens on 50% of the files I upload.

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.

Im also having this issue which indeed is making CDN unusable. I have to point everything to Origin since that seems to work fine.

Yes me too.
Crazy that there is no response. This is a big problem?
This has been an issue for 2 years now.

The only fix I have found is to:

Manage Permissions -> Public

Before you click on the CDN link.

I was getting the exact same issue.

I found out my issue was due to Cloudflare caching. I purged the cache for the subdomain and also switched to DNS only for the CNAME in the control panel. This fixed it straight away.

Hope this helps.

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.