Added check for HTTP_X_FORWARDED_SSL header.