hezzze/strapi-provider-upload-oss

Image URL is wrong when deploy admin panel to a separate server

Closed this issue · 4 comments

Hello,

as I deployed the admin panel to another server according to the doc, the image URLs become https://backend.com//OSS_BASE_URL/xxxx.jpg. They instantly become normal after deactivation of the plugin. (https://backend.com/uploads/xxxx.jpg)

Woud you please check out the issue?

hey @lodisy are you trying to use the plugin for uploading images to OSS? If so can you check if you have set environment variable for BASE_URL in your frontend server?

Frontend? Do you mean the seperated admin panel? It's static so I depolyed on vercel.

I just set the base url in plugin.js file ( //oss.xxx.com ). And the images won't show up in the media gallery due to the links.

Hello,

as I deployed the admin panel to another server according to the doc, the image URLs become https://backend.com//OSS_BASE_URL/xxxx.jpg. They instantly become normal after deactivation of the plugin. (https://backend.com/uploads/xxxx.jpg)

Woud you please check out the issue?

in develop, you can set the baseUrl: env('BASE_URL', '//xxxxxxx.aliyuncs.com')
but somehow in production, you must be add http:,like below
baseUrl: env('BASE_URL', 'http://xxxxxxx.aliyuncs.com')

Hello,
as I deployed the admin panel to another server according to the doc, the image URLs become https://backend.com//OSS_BASE_URL/xxxx.jpg. They instantly become normal after deactivation of the plugin. (https://backend.com/uploads/xxxx.jpg)
Woud you please check out the issue?

in develop, you can set the baseUrl: env('BASE_URL', '//xxxxxxx.aliyuncs.com')
but somehow in production, you must be add http:,like below
baseUrl: env('BASE_URL', 'http://xxxxxxx.aliyuncs.com')

hey @lodisy did the above solve the problem?