Add head option to proxy.

Cherry pick to upstream