Fixes #3279: Second implementation of the Apache reverse proxy Technique (much improved for DRYness and general cleanliness, follows nearly all the new coding guidelines excepts the reporting ones