Is there any settings to avoid 502 before Azure LB default idle timeout(4m)

Hello,

I have a setup as below to upload large file(~2G), we exposed the HAProxy and ISTIO GW service via Azure LoadBalancer(default idle time is 4 munities),

the application is need 6+ munites to proceed these data after received data.

The ISTIO GW is closed the connection and give the response to HAProxy when the Azure LB default idle time is reached(before get response from Application), even through it didn’t get response from Application.

if I change the Azure LB idle time to 30 munites(10m should be OK). everything is working(all get HTTP: 200).
But we don’t to change the Azure LB idle time, is there any way to solve this by adjust HAProxy configuration(tried timeout tunnel/timeout http-keep-alive, no help)?

HAProxy(2.6) backend timeout settings:
timeout connect 1h
timeout server 1h
http-reuse always

Application ISTIO VS timeout settings:
timeout 1h

Thanks!

Try turning on TCP keepalives in the default section, to keep the connection alive:

defaults
    clitcpka-cnt 8
    clitcpka-idle 30s
    clitcpka-intvl 30s
    option clitcpka
    
    srvtcpka-cnt 8
    srvtcpka-idle 30s
    srvtcpka-intvl 30s
    option srvtcpka

Refer to the manual for individual explanations of those keywords.

I tried to add above configuration(changed 30s to 30m), it is still get same issue.

It needs to be 30 seconds, not 30 minutes.