This isn't really an HHVM issue, more trying to do rewriting at the same time as proxying.
Doing a quick google search yields another answer which might help.