diff options
author | John Klug <john.klug@multitech.com> | 2019-12-04 18:09:39 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2019-12-04 18:09:39 -0600 |
commit | 0ad36d5815601f16a632d3142d449f64293f96ea (patch) | |
tree | 996064fc321c8b04938887dceea0786d89de1a23 | |
parent | 76b5dfb8142e7c8afde7c3664a6dfc755bae3484 (diff) | |
download | commissioning-0ad36d5815601f16a632d3142d449f64293f96ea.tar.gz commissioning-0ad36d5815601f16a632d3142d449f64293f96ea.tar.bz2 commissioning-0ad36d5815601f16a632d3142d449f64293f96ea.zip |
Add port 80 redirect to 443
-rw-r--r-- | etc/lighttpd-commission.conf | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/etc/lighttpd-commission.conf b/etc/lighttpd-commission.conf index 5317eb5..38591eb 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 = 80 +#server.port = 81 ## bind to localhost (default: all interfaces) #server.bind = "grisu.home.kneschke.de" @@ -234,15 +234,21 @@ 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" |