Frage

I have this HAProxy config file:

frontend main
    bind *:80
    use_backend drewgrosscom if { hdr(host) -i drewgross.com }
    use_backend drewgrosscom if { hdr(host) -i www.drewgross.com }

backend drewgrosscom
    server app1 127.0.0.1:8000 check inter 5000 rise 1 fall 1

But I'm getting "no data received" on both drewgross.com and www.drewgross.com. Accessing www.drewgross.com:8000 and drewgross.com:8000 both work fine though. Any ideas what is going on?

War es hilfreich?

Lösung

You need to set mode http. This should work:

defaults
    mode http

frontend main
    bind *:80
    use_backend drewgrosscom if { hdr(host) -i drewgross.com }
    use_backend drewgrosscom if { hdr(host) -i www.drewgross.com }

backend drewgrosscom
    server app1 127.0.0.1:8000 check inter 5000 rise 1 fall 1
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top