about summary refs log tree commit diff stats
path: root/Caddyfile
blob: 9fce1be7099d93a83e0b84515197383675f5902b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
	admin off
	persist_config off
	auto_https disable_redirects
	acme_ca https://acme.zerossl.com/v2/DV90
	import globals/*
	order advanced_metrics before file_server
	order advanced_metrics before reverse_proxy
	servers :80 {
		protocols h1 h2c
		trusted_proxies static private_ranges
	}
}

http://,
http://alanpearce.uk,
http://www.alanpearce.uk,
http://www.alanpearce.eu {
	header Cache-Control max-age=31536000
	redir https://alanpearce.eu{uri} permanent
}

http://aln.pe {
	header {
		Cache-Control max-age=86400
		X-Content-Type-Options nosniff
		Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
	}

	redir /pronouns https://en.pronouns.page/@alanpearce
	redir /pronomen https://de.pronouns.page/@alanpearce
	redir /git https://git.alanpearce.eu
	redir /gpg https://alanpearce.eu/public_key.asc
	redir /* https://alanpearce.eu/{uri}
}

http://alanpearce.eu {
	advanced_metrics {
		port 9091
	}
	root * {$SITE_ROOT}
	file_server {
		precompressed br zstd gzip
	}
	header {
		Cache-Control max-age=14400
		X-Content-Type-Options nosniff
		Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
	}
	handle_errors {
		@404 expression `{err.status_code} == 404`
		handle @404 {
			rewrite * /404.html
		}
		file_server {
			precompressed br zstd gzip
		}
	}
	header /feed-styles/ Content-Type text/xsl
	error /feed-styles/index.html* 404
	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}
}