Domain conditions follow resolve results, HTTP Host, or TLS Server Name Indication. If an app connects by IP, or omits SNI, rules may only see an address, so every domain line misses and the request lands on IP-CIDR, GEOIP, or FINAL.
That is one source of “the same site is sometimes proxied, sometimes direct”: some requests carry a hostname, some only have an IP. The browser address bar shows www.example.com while the socket may first connect to a CDN address; GEOIP sees that CDN’s library, not your impression of the name.
When system DNS and in-app DNS are each set and contradict each other, the hostname rules see and the real destination can disagree. When resolution is not the anomaly, do not change both at once. Details in DNS.
Rewrite runs after the request is already seen; it cannot replace rules in deciding which path to take. Route first, then rewrite. Body-level HTTPS rewrite also needs extra decrypt permission; see System.