diff options
author | Wojtek Kosior <koszko@koszko.org> | 2023-09-09 17:40:35 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2023-09-09 17:40:35 +0200 |
commit | d43ba46b1cdbc40b562cbc8d149b813f91a16b66 (patch) | |
tree | 425658951447d67c2972bd43922d4309467dd001 | |
parent | 26c06d07e2d201c0c7f02eee10038b8d9d5dda64 (diff) | |
download | koszko-org-server-d43ba46b1cdbc40b562cbc8d149b813f91a16b66.tar.gz koszko-org-server-d43ba46b1cdbc40b562cbc8d149b813f91a16b66.zip |
Redirect HTTP sites to HTTPS
-rw-r--r-- | container.scm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/container.scm b/container.scm index ef97dc1..2cab0f4 100644 --- a/container.scm +++ b/container.scm @@ -114,6 +114,14 @@ ,(httpd-directive 'ServerAdmin "koszko@koszko.org") ,(httpd-tag 'If (list (format #f "%{HTTP_HOST} != '~a'" name)) (httpd-directive 'Redirect 'permanent "/" + (format #f "http~a://~a/" + (if tls? "s" "") name))) + ,(httpd-tag 'ElseIf + (list (format #f "~a && (~a !~~ ~a)" + (if tls? "false" "true") + "%{REQUEST_URI}" + "m#^/[.]well-known/acme-challenge/.*#")) + (httpd-directive 'Redirect 'permanent "/" (format #f "https://~a/" name))) ,(httpd-directive 'Alias "/.well-known/acme-challenge" "/srv/http/acme-challenge/") |