# Reverse proxy TLS. Caddy obtient et renouvelle seul le certificat Let's Encrypt.
{
	email {$ACME_EMAIL}
}

{$PUBLIC_DOMAIN} {
	encode gzip zstd

	# HSTS : un an, sous-domaines inclus. À n'activer qu'une fois le HTTPS stable.
	header {
		Strict-Transport-Security "max-age=31536000; includeSubDomains"
		-Server
	}

	# Le webhook Stripe doit rester joignable sans restriction d'origine.
	handle /api/payments/webhook {
		reverse_proxy api:8000
	}

	handle /api/* {
		reverse_proxy api:8000
	}

	handle {
		reverse_proxy web:8080
	}
}
