This was cherry-picked from the gomod branch instead of being merged as
a PR for two reasons:
1) The vhost plugin addition isn't yet ready for merging, as there's
a lot of code duplication.
2) This code can technically be merged as is without the mods to the
vhost plugin.
When/If we're ready to merge the vhost plugin we'll fix that side up.