Strapi Media Image Throwing 403 error but works on direct browser

I am getting 403 error when I try to use img src=‘’ The URL works fine but I am getting an error when programmatically I try to do. Everything else the apis, graphql works.

Though this is an old question, I am replying here for someone else who could be facing this issue. In our case the Strapi server was proxied through CloudFlare, and it was blocking cross site requests under Hotlink Protection.

Angular was running on localhost:4200 and the strapi server was hosted on

One can add a firewall rule to allow this traffic. We worked around the problem by directly using the AWS DNS name, bypassing CloudFlare, for local Angular environment.