500 series errors imply an issue connecting upstream.
Most commonly this is due to misconfiguration, either in Caddy or in the upstream server itself.
Without more information, I hesitate to speculate further; there’s too many possibilities to simply enumerate all the ways something could be going wrong.
Reverse proxying functions fine for me on Caddy v2.0.0.
With an arbitrary subfolder and arbitrary upstream, I’m able to get a working response via reverse proxy.
If you don’t want to give us any of the information on a help template, all I can do is suggest that perhaps your own troubleshooting efforts should be directed at emulating the kind of requests Caddy would be making, perhaps via curl commands run from the Caddy host, and inspecting that side of the process (Caddy <-> upstream HTTP communication) manually.
I noted that in your original post, the hostname is d1ynnfmvgy6pnn.cloudfront.net, which has no A records and naturally produces errors for me too, specifically Status 502, when I try to reverse proxy to it.
I tested with the hostname you’ve posted most recently, d1yhnfmvgy6pnn.cloudfront.net, and got a good result:
I am sorry about before. It was my mistake and it is working now. What I did was I also reverse_proxy cdn fetching origin url. So, cdn got the problem in loading those files since they were fetched from cdn to cdn not from server to cdn. My apologies.