No such site at :80

So you’re connecting externally from test.prj.mydomain.com, but internally from mydomain.com:32776?

Is the service you have at :32776 configured to respond to requests for host test.prj.mydomain.com?

You might try a simpler Caddyfile to rule out proxy issues:

test.prj.mydomain.com {
    browse
}

Then load up test.prj.mydomain.com and see if you get a response from Caddy at :80. Logging will also help you here to determine what Caddy’s doing with requests for this site.