Redirect scheme on SSL Handshake Error

I have the following configuration:

listen kibana_external
bind 192.168.151.92:5601 ssl crt /etc/haproxy/haproxy.pem
http-request set-header X-Forwarded-Proto https if { ssl_fc }
server foo 192.168.151.148:5601 check inter 2000 rise 2 fall 5
server foo2 192.168.151.149:5601 check inter 2000 rise 2 fall 5

This works great when a user goes to https://192.168.151.92:5601/

When users go to http://192.168.151.92:5601/, they get an empty reply and HAProxy logs an SSL Handshake Error. I would like for HAProxy to send a Redirect Scheme. Can this be done?

1 Like

Maybe I asked this wrong. I think this should be easy.
I want to listen on port 5601.
If an HTTP request comes in, redirect scheme to HTTPS, keeping the same port 5601.
When an HTTPS request comes in, map to a server.

There has been a post with an answer about this see here.