I’ve got a lighttpd server behind an AWS load balancer. The ELB handles all the SSL stuff for me and forwards the requests to lighttpd over HTTP on port 80, setting the X-Forwarded-Proto header along the way.
As I only want to have one specific page go via HTTPS and everything else over HTTP, I wanted to setup redirects in the lighttpd config file, like:
$HTTP["scheme"] == "https" {
$HTTP["host"] !~ ".*ttc/(index.html)?$" {
$HTTP["host"] =~ "(.*)" {
url.redirect = ( "^(.*)$" => "http://%1$1")
}
}
}
This, of course, doesn’t work, as lighttpd only sees HTTP requests…
I had a look at mod_extforward, but that only seems to provide access to the X-Forwarded-For header.
I’ll appreciate any suggestions on how to address this, without switching away from lighttpd.