strapi-provider-upload-google-cloud-storage icon indicating copy to clipboard operation
strapi-provider-upload-google-cloud-storage copied to clipboard

API returns bucket url instead of cdn url

Open rrubio opened this issue 3 years ago • 2 comments
trafficstars

Under development i used the default cloudstorage url -

"baseUrl: 'https://storage.googleapis.com/{bucket-name}'".

Works perfectly, however, i'm ready to go into production now, i've created a load balancer cdn -

"media.mysite.com".

Updating "baseUrl" to "media.mysite.com" does not change the return data "url" containing the original URL (example below) -

https://storage.googleapis.com/my-bucket/my-folder/my-image.jpg

Any help is much appreciated.

rrubio avatar May 03 '22 13:05 rrubio

Hi @rrubio,

In fact, for each media, the relative url is saved in database, so all "old" files must be renamed manually by updating url field of media table. New uploaded files will have the new url name (in theory, this is working for me with Strapi 3).

Thanks

Lith avatar Jun 06 '22 10:06 Lith

Did you solve this?

darrenhaken avatar Jul 07 '22 10:07 darrenhaken

@Lith apologies for the late response. The issue for me was related to not using the new "deep" population. I ended up using this plugin - https://market.strapi.io/plugins/strapi-plugin-populate-deep

rrubio avatar Apr 17 '23 11:04 rrubio