Skip to content

Instantly share code, notes, and snippets.

@vicendominguez
Last active August 29, 2015 13:56
Show Gist options
  • Save vicendominguez/9056884 to your computer and use it in GitHub Desktop.
Save vicendominguez/9056884 to your computer and use it in GitHub Desktop.
Full site in SSL with exception of knowledged path in lighttpd
# When http then https but no redirect for "knowledgebase" path
$HTTP["scheme"] == "http" {
$HTTP["host"] =~ "secure.site.com" {
url.redirect = ( "^/(?!(knowledgebase).*)" => "https://secure.site.com/$1" )
server.document-root = "/site/secure"
}
}
#behavior for SSL
$HTTP["scheme"] == "https" {
$HTTP["host"] =~ "^secure\.site\.com" {
ssl.engine = "enable"
server.document-root = "/site/secure"
server.max-keep-alive-idle = 3
}
#if "knowledgebase" is accessed from inside of the SSL site then exit to http!
$HTTP["url"] =~ "knowledgebase" {
setenv.add-environment = ( "HTTPS" => "off" )
ssl.engine = "disable"
url.redirect = ( "^/(.*)" => "http://secure.site.com/$1" )
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment