编辑lighttpd.conf文件,添加以下内容

#force https
$SERVER["socket"] == ":80" {
    $HTTP["host"] =~ "([^:/]+)" {
        url.redirect = ( "^/(.*)" => "https://%0:443/$1" )
    }
}

即可。