Multiple reverse proxy support

Apache for one allows the X-Forwarded-Host to be a comma seperated
list rather than a single value. See:
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers

The structure has also been simplied to if/else to make it more
readable.
reflect change
Merge branch 'multiple_reverse_proxy'