Fix minor cs issues
User HTTP_HOST instead of SERVER_NAME

SERVER_NAME holds the name configured in the server setting and thus can
not be used, if the same server is used under different names.
HTTP_HOST instead contains the currently requested hostname. This also
includes the correct format for IPv6 in URLs and a port if appended.