From b4f1730b5a708cf3b3caf5b593552533b444007f Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 4 Dec 2019 18:39:04 -0600 Subject: Fix redirect from http. --- etc/lighttpd-commission.conf | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/etc/lighttpd-commission.conf b/etc/lighttpd-commission.conf index 38591eb..5317eb5 100644 --- a/etc/lighttpd-commission.conf +++ b/etc/lighttpd-commission.conf @@ -136,7 +136,7 @@ static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) ######### Options that are good to be but not neccesary to be changed ####### ## bind to port (default: 80) -#server.port = 81 +server.port = 80 ## bind to localhost (default: all interfaces) #server.bind = "grisu.home.kneschke.de" @@ -234,21 +234,15 @@ fastcgi.server = ( ".php" => ssl.engine = "enable" ssl.pemfile = "/var/config/server.pem" -$HTTP["scheme"] == "http" { - # capture vhost name with regex conditiona -> %0 in redirect pattern - # must be the most inner block to the redirect rule - $HTTP["host"] =~ ".*" { - url.redirect = (".*" => "https://%0$0") - } -} - $SERVER["socket"] == ":443" { ssl.engine = "enable" ssl.pemfile = "/var/config/server.pem" ssl.use-sslv3 = "enable" ssl.openssl.ssl-conf-cmd = ("Protocol" => "-ALL, -TLSv1, -SSLv3") server.document-root = "/www/commission" -} +} else $HTTP["host"] =~ "^(.+)(:[0-9]+)?$" { + url.redirect = ( "^/(.*)$" => "https://%1:443/$1" ) +} #### status module #status.status-url = "/server-status" -- cgit v1.2.3