Fixes #7173
This PR implements functions to get the right ip, scheme from the incoming proxied requests.
req.Host is used to construct the final object location. Fixes #4910