How to set up {siteUrl} to work with both http and https
One method is using something like the following in your general.php file.  Using this method the config settings will take on the scheme of the request being made.  I've set both the siteUrl and example environmentVariables below:

&lt;?php

// Ensure our urls have the right scheme
define('URI_SCHEME',  ( isset($_SERVER['HTTPS'] ) ) ? "https://" : "http://" );

// The site url
define('SITE_URL',    URI_SCHEME . $_SERVER['SERVER_NAME'] . '/');

// The site basepath
define('BASEPATH',    realpath(CRAFT_BASE_PATH . '/../') . '/');

return array(
    '*' =&gt; array(

        'siteUrl' =&gt; SITE_URL,

        'environmentVariables' =&gt; array(
            'siteUrl'  =&gt; SITE_URL,
            'basePath' =&gt; BASEPATH
        ),
    ),
);