Update system/core/Common.php

If using nginx instead of apache by default nginx will not populate the $_SERVER['HTTPS'] value.  This change allows falling back to checking the port number of the request to determine if your on SSL or not.

The other option is adding the following to your nginx config.

fastcgi_param HTTPS on; #some php apps require this to detent https