--- etc/lighttpd.conf 2008/04/09 21:33:50 63 +++ etc/lighttpd.conf 2008/04/09 22:21:30 64 @@ -1,15 +1,32 @@ -# a3c +# libhttpd configuration for A3C + +# create certificate with +# openssl req -new -x509 -keyout a3c.pem -out a3c.pem -days 365 -nodes + server.modules += ( "mod_fastcgi" ) -server.document-root = "/srv/A3C/share/web/templates" -fastcgi.server = ( "" => - (( - "socket" => "/tmp/a3c.socket", - "check-local" => "disable", - "bin-path" => "/srv/A3C/bin/jifty", - "bin-environment" => ( "JIFTY_COMMAND" => "fastcgi" ), - "min-procs" => 1, - "max-procs" => 5, - "max-load-per-proc" => 1, - "idle-timeout" => 20, - )) -) +server.modules += ( "mod_redirect" ) + +$SERVER["socket"] == "192.168.50.127:443" { + protocol = "https://" + + ssl.engine = "enable" + ssl.pemfile = "/srv/A3C/etc/a3c.pem" + + server.document-root = "/srv/A3C/share/web/templates" + fastcgi.server = ( "" => + (( + "socket" => "/tmp/a3c.socket", + "check-local" => "disable", + "bin-path" => "/srv/A3C/bin/jifty", + "bin-environment" => ( "JIFTY_COMMAND" => "fastcgi" ), + "min-procs" => 1, + "max-procs" => 5, + "max-load-per-proc" => 1, + "idle-timeout" => 20, + )) + ) + +} else $HTTP["host"] =~ "(.*)" { + url.redirect = ( "^/(.*)" => "https://%1/$1" ) +} +