Search code examples
google-cloud-platformgoogle-cloud-storagegoogle-cloud-cdn

Public object in cloud storage bucket isn't accessible through load balancer


I have CDN setup for my Google CLoud Storage bucket. I have uploaded a public object, you can see it with the public link here: https://storage.googleapis.com/staging.twinkle-4acfc.appspot.com/example_out_message_bg.9.png

So in order for the CDN to work, as per this question, I need to access the bucket through the load balancer.

Okay, so I setup the load balancer, this URL is directed to the bucket, and it is a public object, but the response contains an XML access error.

http://130.211.26.19/stagemedia/example_out_message_bg.9.png

In fact, you can change the path to anything, just try /a, the error is the same. Is the load balancer set up incorrectly?


Solution

  • Your object needs to match the whole path, which in this case is "stagemedia/example_out_message_bg.9.png". Try creating an object with that whole name, including the "stagemedia/" part.