I’m new to Google Cloud Storage (GCS). I’ve been trying to setup my personal blog website. This website will be using images as well. For hosting images, I use GCS bucket with a load balancer with CDN caching.
When I try to load any blog post with images, the images from GCS gives 403 forbidden error when v3/signer API fails to authenticate. I want to make sure that user visiting my website without any Google login should be able to view images on my blog post.
Recently I did following with my GCS bucket:
- Added CORS policy.
[
{
"origin": ["https://link-to-my-blogpost.com"],
"responseHeader": ["Content-Type"],
"method": ["GET"],
"maxAgeSeconds": 3600
}
]
-
Updated bucket permissions (access control) to fine-grained object level ACLs. Earlier it was set to uniform.
-
After this I ran a command to update ACL of bucket:
gsutil -m acl -r set public-read gs://my-bucket-name
-
Public access is subject to object ACLs.
For reference attaching screenshot of the error:
I’m still facing 403 forbidden error due to which images are not getting loaded on my website. It would be a great help if anyone can help me figure out what I’m missing. Thanks!