502 error when proxy to caddy https upstream

it’s here: https://github.com/mholt/caddy/issues/2427
but it’s closed few days ago.