# Haproxy map backend by domain name not working on https

**URL:** <https://discourse.haproxy.org/t/haproxy-map-backend-by-domain-name-not-working-on-https/7225>\
**Category:** Help!\
**Created:** [December 18, 2021, 1:33am UTC](https://discourse.haproxy.org/t/haproxy-map-backend-by-domain-name-not-working-on-https/7225 "2021-12-18T01:33:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bistami](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@bistami](https://discourse.haproxy.org/u/bistami)\
**Post date:** [December 18, 2021, 1:33am UTC](https://discourse.haproxy.org/t/haproxy-map-backend-by-domain-name-not-working-on-https/7225/1 "2021-12-18T01:33:14Z")

</div>

My config file:

```auto

defaults
  mode http
  maxconn 1024
  option httplog
  option dontlognull
  retries 3
  timeout connect 10s
  timeout client 60s
  timeout server 60s

listen stats
    bind *:4443
    stats enable
    stats hide-version
    stats uri /stats

frontend rotating_proxies
  bind *:5555
  use_backend ifconfig if { req.hdr(host) -i ifconfig.me }
  use_backend ipinfo if { req.hdr(host) -i ipinfo.io }
  mode http
 
 
  backend ipinfo
   
    balance leastconn # http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#balance
    mode http 

    server web1 154.85.50.80:5222

    server web2 154.85.70.80:5222

 
   backend ifconfig

    balance leastconn # http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#balance
    mode http

    server web1 154.85.100.80:5222

    server web2 154.85.90.80:5222

```

I will map backend by incoming domain name, Haproxy should use backend ipinfo if incoming host is [ipinfo.io](http://ipinfo.io), backend ifconfig if incoming host is [ifconfig.me](http://ifconfig.me)

On http request everything works.  
On https side get error proxy aborted.  
E.g.

```auto
curl -x 127.0.0.1:5555 http://ifconfig.me —> works

curl -x 127.0.0.1:5555 https://ifconfig.me —> Error proxy aborted

```

If i set default\_backend on https side it works but i will map backend by https domain name.

BR

---

<div class="post-metadata">

**Author:** ![rhada](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/rhada/32/585_2.png) [@rhada](https://discourse.haproxy.org/u/rhada)\
**Post date:** [December 20, 2021, 11:14am UTC](https://discourse.haproxy.org/t/haproxy-map-backend-by-domain-name-not-working-on-https/7225/2 "2021-12-20T11:14:14Z")

</div>

Hello,

I don’t see any SSL related config in your file. The first thing to do is to configure SSL if you want it to works
