better behind proxy handling