[Fix] Nginx: https/http protocol detection

In Nginx the `$_SERVER['HTTPS']` is always set, but when it is not https, it will be empty.

In Wordpress they use the following function
```
function is_ssl() {
    if ( isset($_SERVER['HTTPS']) ) {
        if ( 'on' == strtolower($_SERVER['HTTPS']) )
            return true;
        if ( '1' == $_SERVER['HTTPS'] )
            return true;
    } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
        return true;
    }
    return false;
}
```

Checking for the port is not very good, imho, but the first part of the function should be correct.
Instead of checking for the variable not to be 'off', you should check for it to be 'on'.

I have tested it on Nginx with/without https. I have tested it on Apache without https, but haven't any https Apache hosts where I can check it.