I'm attempting to setup a reverse proxy using Apache on my local machine, I have the following in my httpd.conf:
ProxyPass /app http://x.com ProxyPassReverse /app http://x.com
Everything works great and browsing to 127.0.0.1/app/* works as expected. The problem arises when I browse to a url that performs a redirect to a resource at the same hostname but a different port. Initially I thought I could handle this situation as follows:
ProxyPass /app:81 http://x.com:81 ProxyPassReverse /app:81 http://x.com:81
But whilst this works, cookies don't appear to carry across the redirect. How would I get cookies to carry across the redirect? Also whilst the port is actually known in advance, is there a more robust method of handling this such that a redirect to any arbitrary port is handled correctly?