title: ProxyPassMatch with ProxyPassReverse
body: <p>Folks,
  We are trying to setup Apache reverse proxy for the following scenario:</p>
  
  <ul>
  <li>Incoming requests take the form <code>http://foo.com/APP/v1/main.html</code></li>
  <li>For some servers the URL will reference a difference version, say, <code>http://foo.com/APP/v2/main.html</code></li>
  <li>An upstream load balancer (HAProxy) will send the request to the right server which will have an Apache2 reverse proxy fronting a JBoss server.</li>
  <li>When the request shows up at Apache 2 it will have request path like <code>/APP/v1/main.html</code></li>
  <li>We want it to (reverse) proxy out to <code>http://localhost:8080/AppContext/main.html</code>, <em>irrespective</em> of version fragment in URL (v1, v2, etc.).</li>
  </ul>
  
  <p>I have been trying to do this like so:</p>
  
  <pre><code>ProxyPassMatch ^/.*?/APP.*?/(.*)$ http://localhost:8080/AppContext/$1
  ProxyPassReverse /APP http://localhost:8080/AppContext
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li>Is my use of <code>ProxyPassMatch</code> correct?</li>
  <li>My <code>ProxyPassReverse</code> is "static". How do I make it aware of the potentially variable stuff after <code>/APP</code>?</li>
  </ol>
  
  <p>Thanks for any insights.</p>
  
  <p>-Raj</p>