Procedure for Lighttpd Server configuration:
- Install the SSL certificate in /etc/lighttpd/certs, for example /etc/lighttpd/certs/cert.pem
- Add the following lines in /etc/lighttpd/lighttpd.conf:
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/lighttpd/certs/cert.pem" # use the path where you created your pem file
}
- Also add in /etc/lighttpd/lighttpd.conf file redirections of all HTTP request in HTTPS:
$SERVER["socket"] == ":80" {
$HTTP["host"] =~ "(.*)" {
url.redirect = ( "^/(.*)" => "
https://%1/$1
" )
}
}
- Restart Lighttpd Server: /etc/init.d/lighttpd restart