tds/src/main/java/thredds/servlet/ServletUtil.java
public static String getRequestServer(HttpServletRequest req) {
    return req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort();
  }
public static String getRequestServer(HttpServletRequest req) {
    return req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort();
  }
This is the server part, eg http://motherlode:8080

@param req the HttpServletRequest
@return request server