How to change image paths to relative instead of absloute inside post content images

Hi, I am facing an issue on the post content images, I am trying to append a CDN URL before the path on each image when I am trying it for images inside the post content, it throws errors since the URL is an absolute path, is there a way to change the URL to relative or is there any javascript generating this piece of the image?

 <div class="post-content">
                <figure class="kg-card kg-image-card"><<img src="http://localhost:2369/agile/content/images/2020/09/sample.jpg" class="kg-image" alt="" srcset="http://localhost:2369/agile/content/images/size/w600/2020/09/sample.jpg 600w, http://localhost:2369/agile/content/images/size/w1000/2020/09/sample.jpg 1000w, http://localhost:2369/agile/content/images/2020/09/sample.jpg 1024w" sizes="(min-width: 720px) 720px"></figure><p>

the above image returns an absolute URL (http://localhost:2369/agile/content/images/size/w600/2020/09/sample.jpg 600w) instead I need (/agile/content/images/size/w600/2020/09/sample.jpg 600w)

is that possible and which script page is this image generated from?