문제

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?

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top