Files
paperspec/deploy/Caddyfile
T
alexm 2fd3307147
check.yml (push) Invalid workflow file
First implementation (#1)
Reviewed-on: #1
2026-10-15 09:50:22 -04:00

40 lines
1.6 KiB
Caddyfile

<<<<<<< HEAD
# Serves the paperspec website built by `paperspec site` (`pixi run site`, the `_site/` folder), copied to /srv/www/paperspec.
||||||| parent of 4fa326d (First implementation (#1))
=======
# Serves the paperspec website built by `python3 tools/site.py` (the `_site/` folder), copied to /srv/www/paperspec.
>>>>>>> 4fa326d (First implementation (#1))
# The site mirrors the repository, so every schema is served at its $id and the JSON-LD context at the address
# layers name; this file sets the media types those addresses need and lets any page fetch them.
paperspec.scient.ing {
root * /srv/www/paperspec
encode zstd gzip
# Every file may be fetched from any origin: JSON-LD processors and schema validators in browsers need it.
header Access-Control-Allow-Origin "*"
header X-Content-Type-Options "nosniff"
# file_server keeps a Content-Type that is already set, so these take precedence over its defaults.
@jsonld path *.jsonld
header @jsonld Content-Type "application/ld+json"
@schema path /schemas/*.schema.json
header @schema Content-Type "application/schema+json"
@jsonl path *.jsonl
header @jsonl Content-Type "application/jsonl; charset=utf-8"
@package path *.sct.zip
header @package Content-Type "application/vnd.scienting.doc+zip"
@text path *.md *.py *.sql *.csv *.hex *.toml *.lock *.txt
header @text Content-Type "text/plain; charset=utf-8"
# Pages and the search index change with each release; data files are cached briefly too, since the
# addresses stay the same across releases while their contents may not.
header Cache-Control "public, max-age=300"
file_server
handle_errors {
rewrite * /404.html
file_server
}
}