Forgive me if there’re duplicate topics but I don’t even know what keywords to search, so I started a new topic describing my problem.
Recently I got update from my CDN provider that they will abandon the legacy URLs like http://7xibfi.com1.z0.glb.clouddn.com/, and suggested me to change the URLs to my custom one http://cdn.iosre.com/ ASAP.
The problem is that most of the old posts on my website, e.g. this one, contains images with the legacy URLs, and they will be not accessible after the CDN provider abandon them.
I have already changed the CDN URL in app.yml and rebuilt discourse, but the legacy URLs will not be affected, right?
Seems the link is what I’m looking for; I will try it once the backup is done. Thanks for the info!
I have tried rake and 44 posts were remapped. But I see another situation in my post, the source of the post looks like <img src="/uploads/default/213/acc63bd2c2d03f28.png" width="496" height="138"> but for readers who don’t have access to the post source and if they copy the image address, it turns out to be http://7xibfi.com1.z0.glb.clouddn.com/uploads/default/213/acc63bd2c2d03f28.png.
And I have tried to grep -r 7xibfi.com1.z0.glb.clouddn.com /var/discourse, turns out this URL appears in databases such as /var/discourse/shared/standalone/postgres_data/base/16400/361518 and css files such as /var/discourse/shared/standalone/uploads/stylesheet-cache/mobile_51397cef7eb3aa4cc8e1939c4ef7156c29bfc9e2.css, and rake doesn’t work on these files.
Any other ideas how can I change all legacy CDN URLs?
EDIT: after a whole night, http://iosre.com/uploads/default/original/1X/735abc46bddabe584790cf2218d5d9bbc1f2501a.png becomes http://cdn.iosre.com/uploads/default/original/1X/735abc46bddabe584790cf2218d5d9bbc1f2501a.png, so I guess it takes a while processing all URLs? I am checking more posts to double confirm.
I did rebuild after changing DISCOURSE_CDN_URL in app.yml.
I tried running rake posts:rebake, now all images with legacy URLs such as http://7xibfi.com1.z0.glb.clouddn.com/uploads/default/original/1X/735abc46bddabe584790cf2218d5d9bbc1f2501a.png become http://iosre.com/uploads/default/original/1X/735abc46bddabe584790cf2218d5d9bbc1f2501a.png, which is hosted right on the server instead of on the CDN.
What can I do to use new CDN host cdn.iosre.com for all legacy URLs?