How to Redirect HTTP to HTTPS admin page

Edit lighttpd config

nano /etc/lighttpd/lighttpd.conf
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
.
# [add after the syntax above]
.
# Redirect HTTP to HTTPS
$HTTP["scheme"] == "http" {
 $HTTP["host"] =~ ".*" {
 url.redirect = (".*" => "https://%0$0")
 }
}

Restart lighttpd Service

1service lighttpd restart

This site uses Akismet to reduce spam. Learn how your comment data is processed.