Avoid following redirections in the proxy server. If final server says redirect, don't redirect, tell the client to do that.