title: How to redirect to multiple servers sitting behind HAProxy which have different path begining
body: <p>I have 3 servers which listen on following port , </p>
  
  <pre><code>&gt; 10.21.5.39:80    --&gt;   api.something.com
  &gt; 10.21.4.234:80    --&gt;   *.something.com
  &gt; 10.21.5.73:80     --&gt;   coolapi.something.com
  &gt; 10.21.5.73:3002    --&gt;   school.something.com
  </code></pre>
  
  <p>I am using a HAProxy server to redirect the traffic to these backends, i am using the following config on haproxy which doesn't seem to workout. </p>
  
  <pre><code>frontend api
         bind *:80
         acl url_api path_beg /api
         use_backend api-backend if url_api
  
  frontend custui
         bind *:80
         acl url_custui path_beg *
         use_backend custui-backend if url_custui
  
  
  frontend backoffice
         bind *:80
         acl url_backoffice path_beg /backoffice
         use_backend backoff-backend if url_backoffice
  
  frontend partnerui
         bind *:80
         acl url_partnerui path_beg /partner
         use_backend partner-backend if url_partnerui
  
  
  backend api-backend
      mode    http
      option  httpchk
      server  api01 10.21.5.39:80
  
  backend custui-backend
      mode    http
      option  httpchk
      server  custui01 10.21.4.234:80
  
  backend backoff-backend
      mode http
      option httpchk
      server backoff01 10.21.5.73:80
  
  
  backend partner-backend
      mode http
      option httpchk
      server backoff01 10.21.5.73:3002
  </code></pre>
  
  <p>So the idea is to let HAProxy listen on 80 and then redirect to the backends listening on the specified port.. Please help</p>