Fix: set scheme correctly according to the request

See php doc: http://www.php.net/manual/en/reserved.variables.server.php

"Set to a non-empty value if the script was queried through the HTTPS
protocol. "

-> !empty()

"Note: Note that when using ISAPI with IIS, the value will be off if the
request was not made through the HTTPS protocol."

-> !== 'off'