# Caddy gets and renews the HTTPS certificate by itself.
# Replace anybot.example.com with your own domain (its DNS must point to this server).
anybot.example.com {
	encode gzip
	# Browsers keep to https here; nothing guesses a file's type; no page frames this one.
	header {
		Strict-Transport-Security "max-age=31536000"
		X-Content-Type-Options "nosniff"
		X-Frame-Options "SAMEORIGIN"
		Referrer-Policy "no-referrer"
	}
	# No request body larger than a backup (the relay has its own, smaller limits per path).
	request_body {
		max_size 210MB
	}
	reverse_proxy relay:8080 {
		# The phone's "anything new?" request waits up to 35 s. Each AnyBot also keeps one
		# WebSocket open here (pinged every 15–20 s, so it never sits idle for 60 s).
		transport http {
			read_timeout 620s
		}
		# Reloading this file doesn't cut those connections at once.
		stream_close_delay 5m
	}
}
