How to use Virtual Private Server as WordPress Image CDN

It sounds you want to do something similar as described in this article https://surpriseazwebservices.com/serve-images-from-sub-domain-in-wordpress/. You’ll need to define your upload_url_path as your private server and also update the path of your existing images by running the following query in MySQL.

UPDATE wp_posts SET post_content = REPLACE (post_content,'http://yoursite.com/wp-content/uploads/','http://img.yoursite.com/'); 

The steps should all be documented in the link.