title: haproxy redirect based on response status code
body: <p>I'm trying to get haproxy to redirect to a new location if it receives a 404 response from a backend server.  If it does not receive a 404, I would like it to respond normally.  </p>
  
  <p>This made sense to me, but doesn't seem to work:</p>
  
  <pre><code>frontend  front
      option httplog
      bind *:8080
      default_backend             app
  
  backend app
      balance     roundrobin
      acl document_request path_beg -i /documents
      acl not_there status 404
      http-request redirect location http://newlocation/%[path] if document_request not_there
      server  webserver1 10.10.10.10:8080 check
  </code></pre>
  
  <p>I received the following warning:</p>
  
  <p>acl 'not_there' will never match because it only involves keywords that are incompatible with 'backend http-request header rule'</p>
  
  <p>I'm using version 1.5.14 on Centos 7.</p>
  
  <p>Any ideas on how to make this work?  Is it possible to do what I am trying to do?</p>
  
  <p>Any assistance would be greatly appreciated.</p>
  
  <p>Thanks,</p>
  
  <p>AL</p>