Change image URL

I’m using the Casper theme for my Ghost site.
I wrote an image proxy script that watermarks any photo you pass through it.

What I’m wondering is how to pass all post/content images through it.

The current blog URL is https://example.com/ but I would like the image base URL to change to https://images.example.com/
Is this possible on a theme level?

1 Like

@Luen I’m interested in finding out the answer to this as well.

Would you mind sharing your image proxy script?

The script is now available at GitHub - Luen/ws-watermark-image: Watermark Wanderstories images

You can see it in action at https://images.wanderstories.space/content/images/size/w1000/2021/10/cannabullen-falls.jpg

Hopefully, there are not any vulnerabilities in the script #notacoder
Please let me know if there is.

1 Like

I ended up just using a CloudFlare worker to rewrite the src and srcset attributes. Done :white_check_mark: