No need to set HTTPS off. nginc v1.1.9 does it by default.

Got some remarks regarding (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) not working anymore. Well, it's because nginx deafults it for either "on" or "off" string. Use it (strtolower($_SERVER['HTTPS']) !== "off")). But still it's not enough, since you can have trafic balancer server in front, which usually uses FORWARD-X headers. Consider settings trusted proxies ;)