Frontend section in HAProxy config file have been splitted in two, one for http, the other for https. Also added X-Forwarded-Proto header to the request.