Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using haproxy-1.5, I have the following partial config:

    acl is_api hdr(host) -i
    acl is_app hdr(host) -i

Unfortunately, the above doesn't match a request that looks like:

GET / HTTP/1.1

Far as I can tell, I need to do:

    acl is_api hdr(host) -i
    acl is_api hdr(host) -i
    acl is_app hdr(host) -i
    acl is_app hdr(host) -i


Is there a nicer way of doing this? Can I just tell haproxy to ignore the port in the host header?

share|improve this question

You might be able to get this to work by checking hdr_dom ( instead of hdr:

acl is_api hdr_dom(host) -i
acl is_app hdr_dom(host) -i

Just be careful because I believe this would also match things like "".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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