about summary refs log tree commit diff stats
path: root/Caddyfile
diff options
context:
space:
mode:
authorAlan Pearce2023-07-02 09:05:52 +0200
committerAlan Pearce2023-07-02 09:05:52 +0200
commitb180e25232ba4fd943c5eb5ff6ca0a1d70ee7e16 (patch)
tree9a93549c7168d3344afd1338a8b714d33c68f911 /Caddyfile
parentb4dc3bd51b45d1343cdf486e4cb54e5e92295534 (diff)
downloadwebsite-b180e25232ba4fd943c5eb5ff6ca0a1d70ee7e16.tar.lz
website-b180e25232ba4fd943c5eb5ff6ca0a1d70ee7e16.tar.zst
website-b180e25232ba4fd943c5eb5ff6ca0a1d70ee7e16.zip
Use fly proxy for TLS termination, using h2c
Diffstat (limited to 'Caddyfile')
-rw-r--r--Caddyfile17
1 files changed, 15 insertions, 2 deletions
diff --git a/Caddyfile b/Caddyfile
index 576a1d0..a53abba 100644
--- a/Caddyfile
+++ b/Caddyfile
@@ -1,16 +1,26 @@
 {
 	admin off
 	persist_config off
-	http_port 8080
+	auto_https disable_redirects
+	acme_ca https://acme.zerossl.com/v2/DV90
+	storage redis {
+	}
+	servers :80 {
+		protocols h1 h2c
+		trusted_proxies static private_ranges
+	}
 }
 
 :9091 {
 	metrics
 }
 
+http://,
+http://alanpearce.uk,
+http://www.alanpearce.uk,
 http://www.alanpearce.eu {
 	header Cache-Control max-age=31536000
-	redir https://alanpearce.eu{uri}
+	redir https://alanpearce.eu{uri} permanent
 }
 
 http://alanpearce.eu {
@@ -37,4 +47,7 @@ http://alanpearce.eu {
 	respond /favicon.ico 204
 	redir /index.xml /atom.xml
 	redir /post/index.xml /atom.xml
+
+	@http header X-Forwarded-Proto http
+	redir @http https://alanpearce.eu{uri}
 }