# HTTPS automático (Let's Encrypt) para {$DOMAIN}. Sin certbot, sin renovaciones manuales.
{$DOMAIN} {
	encode zstd gzip

	@static path /_next/static/*
	header @static Cache-Control "public, max-age=31536000, immutable"

	header {
		Strict-Transport-Security "max-age=31536000; includeSubDomains"
		X-Frame-Options "SAMEORIGIN"
		-Server
	}

	# flush_interval -1: necesario para que el tiempo real (SSE) llegue al instante
	reverse_proxy app:3000 {
		flush_interval -1
		lb_policy least_conn
	}
}
