{$OPENVECTOR_SITE} {
	root * {$OPENVECTOR_DIST}
	header {
		Cross-Origin-Opener-Policy same-origin
		Cross-Origin-Embedder-Policy require-corp
		X-Content-Type-Options nosniff
		Referrer-Policy strict-origin-when-cross-origin
		Strict-Transport-Security "max-age=31536000"
	}
	# The editor ships pre-gzipped files; the landing page's CSS, JS and SVG are compressed on the fly.
	@mutable not path /app/engine/*
	header @mutable Cache-Control "no-cache"
	header /app/engine/* Cache-Control "public, max-age=31536000, immutable"
	encode zstd gzip
	file_server {
		precompressed gzip
	}
	handle_errors 404 {
		rewrite * /404.html
		file_server
	}
}

# One canonical host: send www to the bare domain.
www.{$OPENVECTOR_SITE} {
	redir https://{$OPENVECTOR_SITE}{uri} permanent
}
