0

I have problems with my configuration HaProxy :

frontend http-in
    bind 0.0.0.0:80
    mode http
    #option httplog
    acl site1 hdr(host) -i http://XX.XX.XX.12/games/
    acl site2 hdr(host) -i http://XX.XX.XX.12/videos/
    use_backend backend1 if site1
    use_backend backend2 if site2

 backend backend1
    mode http
    option httpchk
    option forwardfor except 127.0.0.1
    server site1 10.11.12.10:80 maxconn 32

 backend backend2
    mode http
    option httpchk
    option forwardfor except 127.0.0.1
    server site2 10.11.12.2:80 maxconn 32

Can you help me, I think I have problem with if because when I test with only IP, the system is functional.

2
  • Please take time to format your question properly. May 25 '16 at 23:17
  • I don't see an actual question or error message here...
    – GregL
    May 27 '16 at 2:15
0

I think your issue is using hdr(host) in your ACL. You could try it with the path option and it should work.

acl site1 path /games
use_backend backend1 if site1

acl site2 path /videos
use_backend backend2 if site2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.