magento2 – Create new VPS memory images and download files to magento

My pages are very big with image and file upload.

So, I want to set up as a CDN from another Server2 VPS from the current Server1 VPS. This server will upload memory images and files.

I knew that Magento could change the URL storage of baseUrl and baseSecureUrl. However, I do not know how to map 2 servers and sync that.

Can someone suggest me to create such a memory step by step?