Same domain for intranet and wan site

Yes, you can use the remote_ip matcher to make routing decisions. See Request matchers (Caddyfile) — Caddy Documentation