Howdy @Labib, welcome to the Caddy community.
This sounds like The "subfolder problem", OR, "why can't I reverse proxy my app into a subfolder?"
Specifically, it sounds like you don’t have the WordPress Address and/or the Site Address set correctly in your WordPress settings, and as a result it’s redirecting you incorrectly.