user1477388
user1477388

Reputation: 21440

Remove Case Sensitivity for Google Storage Bucket as Load Balancer Backend

We have uploaded our data to a Google Storage Bucket and configured the bucket as the backend of our Google Load Balancer. Therefore, I can access the files via https://images.mywebsite.com.

However, our file names and directories contain both upper and lower case characters.

It appears that Google Storage Buckets are case sensitive, such that if the file is saved as IMAGE.jpg and we request image.jpg we receive the following error:

NoSuchKey

The specified key does not exist.

Is there any way to remove case sensitivity from our Google Storage Bucket? If not, is there any way to resolve this issue such that clients can access our files in a case-insensitive way?

For example, can we rename all the files in our bucket to lowercase, then create some rule on our load balancer to redirect to the lower-case name?

Upvotes: 0

Views: 1543

Answers (1)

Donnald Cucharo
Donnald Cucharo

Reputation: 4126

There's no feature yet to remove case sensitivity on a Storage bucket but you have an option to rename your objects through gsutil or through a Client Library. If you wish to rename your objects programmatically, here's a good example to start with.

If you don't want that option, as you said, you can also create a host and path rule on your load balancer to redirect your objects to a lowercase prefix but you have to do those manually, if you have a lot of objects to rename, that can be a tedious job.

See https://cloud.google.com/load-balancing/docs/l7-internal/traffic-management#routing_requests_to_backends

Upvotes: 1

Related Questions