Last active
August 29, 2015 13:56
-
-
Save vicendominguez/9056884 to your computer and use it in GitHub Desktop.
Full site in SSL with exception of knowledged path in lighttpd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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