Haproxy keeps dropping connections

im using haproxy 1.9 in docker container in aws. For some reason it runs for a bit, then drops connections. One weird thing I noticed is when i run a netstat command I see it listening on the right ports, 443 and 8080 because im binding to them in my config file.
In the past I ran it not in docker and it has always worked fine.

When i run netstat its like this :

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp6 0 0 :::8080 :::* LISTEN -
tcp6 0 0 :::443 :::* LISTEN -
tcp6 0 0 :::5666 :::* LISTEN -
udp 0 0 0.0.0.0:68 0.0.0.0:* -
udp 0 0 127.0.0.1:323 0.0.0.0:* -
udp6 0 0 ::1:323 :::* -

I dont know why its :::443 and :::8080 it has always been 0.0.0.0:443 and 0.0.0.0:8080
maybe its only binding to tcp6 and not tcp4

Im binding same way I have done in the past and its always been fine.

frontend blablabla
bind *:443

the only change has been docker.

any ideas ?

Indeed (if I’m not mistaken) when Linux has enabled support for IPv6, and you use *:443 it will bind on both IPv6 and IPv4. Therefore the issue is unlikely to be due to this fact. If you want to constrain HAProxy to listen only on IPv4 you could use bind ipv4@*:443.


Now regarding your dropped connections, what does HAProxy state in the logs as the cause for the TCP connection termination?

See the manual for an explanation:
http://cbonte.github.io/haproxy-dconv/1.8/configuration.html#8.5

Could you perhaps also take a tcpdump capture of that situation?

Although most likely HAProxy drops the configuration due to timeouts, malformed replies, etc.