Skip to content

Instantly share code, notes, and snippets.

@ozzi-
Created September 19, 2019 13:48
Show Gist options
  • Save ozzi-/7129928bf227546fb4b3b92a22b9e017 to your computer and use it in GitHub Desktop.
Save ozzi-/7129928bf227546fb4b3b92a22b9e017 to your computer and use it in GitHub Desktop.
server.modules += ( "mod_proxy" )
server.modules += ( "mod_auth" )
auth.debug = 2
auth.backend = "plain"
auth.backend.plain.userfile = "/var/lighttpd/.lighttpdpassword"
$HTTP["host"] == "example.localch" {
# Redirect HTTP to HTTPS
$HTTP["scheme"] == "http" {
$HTTP["host"] =~ ".*" {
url.redirect = (".*" => "https://%0$0")
}
}
# Basic Auth
auth.require = ( "/" =>
(
"method" => "basic",
"realm" => "Password protected area",
"require" => "user=eps"
)
)
# Document Root
setenv.add-environment = ("fqdn" => "true")
server.document-root = "/var/www/html/example"
# HTTPS Config
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/lighttpd/certs/example.pem"
ssl.honor-cipher-order = "enable"
ssl.cipher-list = "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"
ssl.use-compression = "disable"
ssl.use-sslv2 = "disable"
ssl.use-sslv3 = "disable"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment