I want help HAProxy Error 502 Bad Gateway with Backend Services

Hello there,

I am facing issue where HAProxy version 2.7.4 is returning a 502 Bad Gateway error when trying to access my backend services.

I have HAProxy Version 2.7.4
HAProxy is configured to load balance requests to multiple backend servers; The backend servers are supposed to handle HTTP requests from HAProxy.

Users are seeing a 502 Bad Gateway error when attempting to access the application; This error occurs intermittently & affects all backend server. The backend servers are up and running, and I can directly access them without issues. when HAProxy attempts to communicate with them.

frontend http_front
    bind *:80
    default_backend http_back

backend http_back
    balance roundrobin
    server server1 192.168.1.10:80 check
    server server2 192.168.1.11:80 check

Also i have Verified that HAProxy’s health checks are configured properly and that backend servers pass these checks.Confirmed that the backend services are running and listening on the correct ports.Examined HAProxy logs and backend server logs for errors or anomalies, but the logs do not provide clear insight into the cause of the issue.

For additional Also i have find additional resources; https://discourse.haproxy.org/t/bad-gateway-in-chrome-and-edge-when-redirect-http-tomendix-interview-questions/ which is helpful response.

I am not sure if the issue is related to HAProxy’s configuration backend server setup or network issues.

Thank you in advance for your assistance :grinning: