Enhanced to pass X-Forwarded-Proto & X-Forwarded-Port, used for Jenkins.getRootUrlFromRequest.