wxs online resource behind varnish/load balancers

Hello @tbonfort 
As discussed, im opening a ticket for this feature request.
Our mapserver services are running behind varnish and load balancers.
In order to provide the correct online resource in the getcapabilities document, mapserver has to read some extra information from the http headers, set by varnish or other proxies.
So if possible, the code that builds the online resource should check for the existance of headers like:
``HTTP_X_FORWARDED_PROTO``
``HTTP_X_FORWARDED_HOST``
If they exist, they should be used for the online resource.