title: HAProxy remove trailing slashes
body: <p>I need to redirect all urls to urls with non trailing slashes</p>
  
  <p>Example:   </p>
  
  <blockquote>
    <p><a href="http://www.example.com/education/" rel="nofollow noreferrer">http://www.example.com/education/</a> -> <a href="http://www.example.com/education" rel="nofollow noreferrer">http://www.example.com/education</a></p>
    
    <p><a href="http://www.example.com/blah//" rel="nofollow noreferrer">http://www.example.com/blah//</a> -> <a href="http://www.example.com/blah" rel="nofollow noreferrer">http://www.example.com/blah</a></p>
    
    <p><a href="http://www.example.com/blah/blah///" rel="nofollow noreferrer">http://www.example.com/blah/blah///</a> -> <a href="http://www.example.com/blah/blah" rel="nofollow noreferrer">http://www.example.com/blah/blah</a></p>
  </blockquote>
  
  <p>This is what I have for now:</p>
  
  <pre><code>frontend localnodes
      bind 127.0.0.1:80
  
      acl has_trailing_slash path_end  /
      reqrep ^(.*)[\ /]$ \1
      redirect prefix / code 301 if has_trailing_slash
  </code></pre>
  
  <p>Refer: <a href="https://stackoverflow.com/questions/29640934/haproxy-remove-trailing-slash">haproxy remove trailing slash</a></p>
  
  <p>But this is just making the browser enter a redirect loop of 301s. How do I achieve this?</p>