I'm moving a web application to a new set of servers in a different data center. As part of a beta period, I want to configure the old server as a reverse proxy for some requests, based on a pattern in the URL.
For example, if someone requests:
... I want to transparently give them the results of
Redirects won't work, as this is used as an API and some clients don't properly follow redirects (fixing the clients isn't an option). Also, this needs to work for both GET and POST requests.
The list of URLs to proxy would be selective, e.g. so that only the
"foo/*" requests would be proxied, and the others would just be served by old.example.com until the final cutover.
mod_proxy the right way to go? I can't find any examples that appear to:
- Allow selective proxying (e.g.
/foo/baris proxied but
- Pass along the entire path and querystring, and
- Keep the POST body and all HTTP headers in tact.
Any help would be greatly appreciated.