[PHP]is_https

public function is_https()
{
    if(!empty($_SERVER["HTTPS"]))
        return true;
    //AWS
    if(!empty($_SERVER["HTTP_X_FORWARDED_PROTO"]) && strtolower($_SERVER["HTTP_X_FORWARDED_PROTO"])==="https")
        return true;
    return false;
}