Fix absoluteURI function to enable port redirection through NAT