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