~cytrogen/realm

ref: ae69ccd7678cd89fde3afc850373aecc1797beab realm/caddy/phase4-live.example.Caddyfile -rw-r--r-- 1.4 KiB
ae69ccd7 — Cytrogen 领地地图上线 cytrogen.icu a month ago
                                                                                
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
# Phase 4: Realm live — cytrogen.icu serves /var/www/cytrogen.icu
#
# This is a reference copy of the realm-relevant Caddy blocks deployed
# to /etc/caddy/Caddyfile. The production Caddyfile also includes blocks
# for sourcehut, beszel, freshrss, stalwart, etc.
#
# Status: DEPLOYED 2026-03-04

# Realm portal
cytrogen.icu, www.cytrogen.icu {
	root * /var/www/cytrogen.icu
	file_server
	encode gzip

	@static path *.css *.js *.jpg *.jpeg *.png *.gif *.ico *.svg *.webp *.woff *.woff2 *.ttf *.eot
	header @static Cache-Control "public, max-age=2592000, immutable"

	@html path *.html /
	header @html Cache-Control "public, max-age=3600, must-revalidate"

	try_files {path} {path}/ {path}.html
}

# Blog (unchanged from Phase 1)
blog.cytrogen.icu {
	root * /var/www/blog.cytrogen.icu
	file_server
	encode gzip

	@static path *.css *.js *.jpg *.jpeg *.png *.gif *.ico *.svg *.webp *.woff *.woff2 *.ttf *.eot
	header @static Cache-Control "public, max-age=2592000, immutable"

	@html path *.html
	header @html Cache-Control "public, max-age=3600, must-revalidate"

	handle_errors {
		@4xx expression `{err.status_code} >= 400 && {err.status_code} < 500`
		handle @4xx {
			rewrite * /{err.status_code}.html
			file_server
		}
		@5xx expression `{err.status_code} >= 500`
		handle @5xx {
			rewrite * /{err.status_code}.html
			file_server
		}
	}

	try_files {path} {path}/ {path}.html
}