Proxy: generic rewrite code from the "proxy_redirect" handlers moved to a separate function with trivial optimization.
Proxy: generic rewrite code from the "proxy_redirect" handlers moved to a
separate function with trivial optimization.

No functional changes.

hy0kl/nginx,firebase/nginx,firebase/nginx,firebase/nginx,hy0kl/nginx,hy0kl/nginx,firebase/nginx