2026-07-11 00:29:47 +00:00
|
|
|
# /etc/caddy/Caddyfile on the VPS.
|
2026-07-11 03:01:16 +00:00
|
|
|
# The domain's A/AAAA record must already point at this VPS — Caddy provisions a
|
|
|
|
|
# Let's Encrypt cert on first request and auto-renews. Nothing else to do for TLS
|
|
|
|
|
# (just make sure ports 80 and 443 are open).
|
|
|
|
|
#
|
|
|
|
|
# Layout on this domain:
|
|
|
|
|
# / -> static portfolio site (served straight from disk)
|
|
|
|
|
# /thermograph/* -> reverse-proxied to the Thermograph uvicorn (loopback)
|
|
|
|
|
#
|
|
|
|
|
# Thermograph must run with THERMOGRAPH_BASE=/thermograph (see /etc/thermograph.env)
|
|
|
|
|
# so the app serves itself under that prefix. The app no longer claims "/", so the
|
|
|
|
|
# root is free for the portfolio.
|
2026-07-11 00:29:47 +00:00
|
|
|
|
2026-07-11 03:01:16 +00:00
|
|
|
emigriffith.dev {
|
2026-07-11 00:29:47 +00:00
|
|
|
encode zstd gzip
|
|
|
|
|
|
2026-07-11 03:01:16 +00:00
|
|
|
# Thermograph — the app serves all pages, assets, and API under /thermograph.
|
|
|
|
|
# Match both the bare prefix and everything beneath it; the app redirects the
|
|
|
|
|
# bare /thermograph to /thermograph/.
|
2026-07-11 03:23:28 +00:00
|
|
|
@thermograph path /thermograph /thermograph/*
|
|
|
|
|
handle @thermograph {
|
2026-07-11 03:01:16 +00:00
|
|
|
reverse_proxy 127.0.0.1:8137
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Portfolio at the root. Point `root` at the built static site (for the Astro
|
|
|
|
|
# portfolio that's its `dist/` output). file_server serves index.html for
|
|
|
|
|
# directories and returns a real 404 for missing paths.
|
|
|
|
|
handle {
|
|
|
|
|
root * /var/www/emigriffith
|
|
|
|
|
file_server
|
|
|
|
|
}
|
2026-07-11 00:29:47 +00:00
|
|
|
|
|
|
|
|
log {
|
2026-07-11 03:01:16 +00:00
|
|
|
output file /var/log/caddy/emigriffith.log
|
2026-07-11 00:29:47 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-11 03:01:16 +00:00
|
|
|
# Optional: redirect www -> apex. Add a www CNAME/A record first, then uncomment.
|
|
|
|
|
# www.emigriffith.dev {
|
|
|
|
|
# redir https://emigriffith.dev{uri} permanent
|
2026-07-11 00:29:47 +00:00
|
|
|
# }
|