backend my_backend_serv
mode http
default-server inter 10s fall 3 rise 2
balance roundrobin
cookie SERVERID insert indirect nocache
http-request set-header X-Forwarded-Port %[dst_port]
http-request set-header X-Forwarded-Proto https if {ssl_fc}
option forwardfor
server SERVER1 127.0.0.1:3000 check inter 5s cookie SERVER1
Cookie check is not required in case it is one server and you don’t need session sticky-ness. However, if authentication cookies are involved, then you need to have sticky sessions.
Keep alive is the default behavior of HAProxy since version 1.5 so that shouldn’t be a problem.