Is there a way to configure apache to act as a proxy server that forwards requests to another proxy server, but formats the URL's if needed (via a perl script) before it sends it to that other proxy?
I've tried a combination of, but haven't gotten it to work:
RewriteEngine On
RewriteMap lb prg:/etc/apache2/lb.pl
RewriteRule ^/(.*) ${lb:$1\&%{query_string}} [P,NC]
Proxypassreverse / ${lb:$1}
ProxyRequests On
ProxyRemote *
http://main-proxy:80