# Caddyfile — Cyrene AI 助手平台反向代理

{
	email {$ACME_EMAIL:admin@localhost}
}

http:// {
	log {
		output stdout
		format json
	}

	header {
		X-Content-Type-Options "nosniff"
		X-Frame-Options "DENY"
		X-XSS-Protection "1; mode=block"
		Referrer-Policy "strict-origin-when-cross-origin"
	}

	# WebSocket 路由
	handle /ws/* {
		reverse_proxy gateway:8080
	}

	# API 路由 → Gateway
	handle /api/* {
		reverse_proxy gateway:8080 {
			header_up Host {http.request.host}
			header_up X-Forwarded-For {http.request.remote.host}
			header_up X-Forwarded-Proto {http.request.scheme}
		}
	}

	# 前端静态文件
	handle {
		respond "Cyrene AI Platform — Frontend coming soon." 200
	}
}
