URL Rewrite for SelfHosted Docker WebApp Using Tunnels


I have a Selfhosted App running in Docker along with a Cloudflare Tunnel Docker in the same internal network. And have exposed the webserver inside the Docker on the internet, and that works fine.

My issue is there are some AJAX requests in the webapp from the client back to the docker with the Wrong URL. Is there anyway to rewrite all the wrong URLs to the correct one, so that they reach the Docker?

My site “mydomain.com” now works, but any Ajax requests goes to from the client web-browser. I need to rewrite “” → “https://mydomain.com/myajaxfunction

Anyhelp would be appreciated. I thought I could use “Transform Rules” - but I was not able to figure it out - or get it to work.