added rewrite to location/proxy & vhost

With credit to https://github.com/OmarzT