# 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
}