Howdy @Leon, welcome to the Caddy community!
Is this verbatim in your Caddyfile?
Caddy will interpret to
here as another host and attempt to round-robin load balance between http://to:80
and http://app:3000
with this config. If to
isn’t a valid host you’re intending to route to, that would explain the consistent intermittent failure.
See examples: reverse_proxy (Caddyfile directive) — Caddy Documentation