fix some problems with the nginx hack for proxy-send-redirect