2

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?

androidguy
  • 3,005
  • 2
  • 27
  • 38

2 Answers2

2

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.

Brandon Yarbrough
  • 37,021
  • 23
  • 116
  • 145
  • Thanks. I see you work on GCS - is this how load-balancing buckets is envisioned to work long term? It seems strange to couple the load balancing rules to the object path in the bucket. I imagine that if I choose to go forward with CDN, I'll just create one LB per bucket. – androidguy Aug 03 '17 at 03:04
  • Follow-up: seeing as how load balancers are expensive, I wouldn't want to run 2 LB's. In fact, at the moment I decided not to use LB or even go through Cloud CDN because of the cost of LB. – androidguy Jan 25 '18 at 22:21
1

You may need to have your object publicly shared as well, as described in docs here: https://cloud.google.com/compute/docs/load-balancing/http/adding-a-backend-bucket-to-content-based-load-balancing#configuring_a_bucket

Ian Walker-Sperber
  • 3,661
  • 2
  • 14
  • 18