Presumably your original request URL was not on 127.0.0.1:8080. Have you tried specifying a transparent proxy:
proxy / 127.0.0.1:8080/phpmyadmin {
transparent
}
FWIW, I know it is often hard to know what relevant details to provide when asking for help. But in this case telling us what the original URL was, whether you were making the request from the system running the system running the Caddy web server, and the nature of the failure (e.g., a 404 not found error) would have helped. More information, within reason, is usually better than too little.
Also, when debugging these types of problems it is usually better to use a CLI tool like curl which can be told to report the HTTP headers, any redirects, etc. rather than a normal browser which will obscure that information.
It looks like you’re being redirected to HTTPS on port 80. The “unexpected TLS packet” is undoubtedly a non-TLS, unencrypted, standard HTTP packet because Caddy’s HTTP-only listener will be on port 80.
I’m not sure why on earth the app would successfully issue a redirect to the HTTPS scheme at the proxied hostname… But instead of using the client request port (443) or the proxy request port (8080) - either of which I’d understand - explicitly redirecting to port 80.
Does the app have a configurable setting to inform it which port it should expect to be served on?