title: HAProxy - Unable to redirect requests with similar URL with path ACL
body: <p>I'm not able to correctly redirect requests of API calls that are very similar in URL.  </p>
  
  <p>My configuration is the following (some parts redacted):</p>
  
  <p>frontend:</p>
  
  <pre><code>frontend https
    bind :443 ssl crt /opt/haproxy/cert
    capture request header X-TRACE len 32
    log-format %ci:%cp\[%t]\ %ft\ %b/%s\ %Tq/%Tw/%Tc/%Tr/%Tt\ %ST\ %B\ %CC\ %CS\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %hr\ %hs\ %{+Q}r
  
    reqadd X-Forwarded-Proto:\ https
  
    use_backend foo if { path -m beg /foo }
    use_backend foo-v2 if { path_sub /foo-v2 }
  </code></pre>
  
  <p>backend:</p>
  
  <pre><code>backend foo
    option httpchk GET /foo/healthcheck HTTP/1.1\r\nHost:\ www\r\nAuthorization:\ Basic\ ...
    http-check expect rstatus 200
    server bar1 xx.xx.xx.xx:xxxx check inter 10s maxconn 2000
  
  backend foo-v2
    option httpchk GET /foo-v2/healthcheck HTTP/1.1\r\nHost:\ www\r\nAuthorization:\ Basic\ ...
    http-check expect rstatus 200
    server bar1 xx.xx.xx.xx:xxxx check inter 10s maxconn 2000
    server bar2 xx.xx.xx.xx:xxxx check inter 10s maxconn 2000
  </code></pre>
  
  <p>As you can see, the only thing that separates the requests from each other is the <code>-v2</code> addition to the v2 requests. However all requests (regardless if with v2 or not) get sent through the first backend instead of matching with the v2 backend when v2 requests are made.</p>