Sequential domain search how?

I try this(not correct work):

frontend http
    bind *:80
    mode tcp
    default_backend http
backend http
    mode tcp
    balance roundrobin
    server web02 check
    server web01 check
frontend https
    bind *:443
    option tcplog
    mode tcp
    default_backend https
backend https
    mode tcp
    balance roundrobin
    option ssl-hello-chk
    server web02ssl check
    server web01ssl check

ssl certs contains in webserver1 and webserver2

i try nginx and cant setup https proxy pass. haproxy like more