Connection reset with "SH" termination code | 502 Bad Gateway

Hi Community,

We are facing a 502 Bad gateway error with “SH” as terminate state in Haproxy access logs and also when we have reviewed tcpdump trace of client-> Haproxy & Haproxy-> backend it show us that Haproxy is sending RST packet.

Additional Info:- When we hit DNS records from the same network Subnet/VLAN in which Haproxy is hosted it works fine without any error and give proper response but above thing is happing only when we hit from outside Subnet/VLAN of Haproxy.

Haproxy Version:- 2.3.6.1.el7.x86_64

So, kindly please help or direct us to mitigate this issue.

Thanks.

We have commented the below line in haproxy.cfg and after that it start giving responses from backend application servers. Earlier there was empty response with 502 Bad Gateway with termination state code as “SH”.

#option forwardfor except 127.0.0.0/8

The actual reason why it’s behaving like this is still in progress ! would keep posted as gets some findings around it.

Thanks.