api.masteronline.space {
	encode zstd gzip

	@masterdeskUpdate path /masterdesk/version/latest
	handle @masterdeskUpdate {
		root * /var/lib/caddy/masterdesk-updates
		rewrite * /latest.json
		file_server
	}

	handle {
		reverse_proxy 127.0.0.1:21114
	}

	header {
		Strict-Transport-Security "max-age=31536000; includeSubDomains"
		X-Content-Type-Options "nosniff"
		X-Frame-Options "SAMEORIGIN"
		Referrer-Policy "strict-origin-when-cross-origin"
		Permissions-Policy "camera=(), microphone=(), geolocation=()"
		-Server
	}

	log {
		output file /var/log/caddy/api.masteronline.space.access.log {
			roll_size 20MiB
			roll_keep 5
		}
		format json
	}
}
