title: create application paths with haproxy
body: <p>I have a server running multiple web apps on different ports without any root application path. I can currently access them by, <a href="http://myServer:8001" rel="nofollow">http://myServer:8001</a>, <a href="http://myServer:8002" rel="nofollow">http://myServer:8002</a>, etc and I would like to access them via HaProxy as <a href="http://myServer/app1" rel="nofollow">http://myServer/app1</a>, <a href="http://myServer/app2" rel="nofollow">http://myServer/app2</a>, etc</p>
  
  <p>I found multiple links using reqrep but i could not make it work. Here is my last attempt before I gave up:</p>
  
  <pre><code>frontend http-in
    option forwardfor
    bind *:80
    acl is-app1 path_beg /app1
    use_backend app1 if is-app1
    acl is-app2 path_beg /app2
    use_backend app2 if is-app2
  
  backend app1
    reqrep ^Location:\ /app1/?(.*)     Location:\ /\1
    rsprep ^Location:\ (.*)     Location:\ /app1/\1
    server localhost 127.0.0.1:8001
  
  backend app2
    reqrep ^Location:\ /app2/?(.*)     Location:\ /\1
    rsprep ^Location:\ (.*)     Location:\ /app2/\1
    server localhost 127.0.0.1:8002
  </code></pre>
  
  <p>From the examples i saw, i expected this single line to be enough (no need for rsprep), but i can't make it work.</p>
  
  <pre><code>reqrep ^([^\ :]*)\ /app1/?(.*)     \1\ /\2
  </code></pre>