title: HAProxy: How to match on hostname instead of the IP address
body: <p>I am trying to match the <code>host</code> request header and use appropriate backend to route the request.</p>
  
  <p>This is what I want to match on (which does not work):  </p>
  
  <pre><code>acl from_external_url req.hdr(Host) -i mydomain.com  
  
  # Chrome dev tools network tab does show mydomain.com set as the Host header
  </code></pre>
  
  <p>However, matching to a direct IP address works (which I don't want):</p>
  
  <pre><code>acl from_external_url req.hdr(Host) -i 22.22.22.22
  </code></pre>
  
  <p>So, how do I make HAProxy route on hostname instead of the IP?</p>
  
  <p>Update 1:</p>
  
  <pre><code>use_backend oid_external if from_external_url
  use_backend oid_internal if !from_external_url
  </code></pre>