:80 {
	root * /srv
	encode gzip

	header {
		X-Content-Type-Options nosniff
		X-Frame-Options DENY
		# Never no-referrer: the analyzer's scrape block lets /api calls through on their Referer
		Referrer-Policy strict-origin-when-cross-origin
	}

	# A missing hashed asset is a 404, never the app shell cached for a year
	handle /assets/* {
		@exists file
		header @exists Cache-Control "public, max-age=31536000, immutable"
		# Max-quality copies from the image build; the rest of the site is encoded per request
		file_server {
			precompressed br gzip
		}
	}

	# Scans for /.env, /.git or *.php get a 404, not the app shell, so ban jails see them as probes
	@probe {
		path */.* *.php
		not path /.well-known/*
	}
	handle @probe {
		respond 404
	}

	# Revalidate the shell so a deploy's new asset hashes are picked up
	handle {
		header Cache-Control "no-cache"
		try_files {path} /index.html
		file_server
	}
}
