<your_domain> {
	 # ➔ 动态匹配 /pump_push/任何设备ID 并完整保留路径转发给 Go 服务
   	reverse_proxy /pump_push/* 127.0.0.1:19999
	# 遇到 /push.html 时，直接返回本地我们写好的老版本兼容页面
	route /push.html {
		root * /opt/go2rtc/www
		file_server
	}
	# 仅对主页、流查看页面等敏感路径开启认证
	@admin_paths {
		path / /static*
		path /api*
		not path /api/webrtc* # ➔ 【关键】放行 Go2RTC 原生的 WebRTC 推拉流接口
	}
	# 加上下面这段基础认证配置
	basic_auth @admin_paths { 
		# 用户名 密文密码 (把刚才复制的那长串粘贴在这里)
		admin $2a$14$7RCVUoPo/kuvVo1ImjX3pe4LC3yNv0d0St8tZms4q5/nEyVV3Fg8G
	}
	# 转发所有 HTTP/WebSocket 请求到 Go2RTC 的 API 端口
	reverse_proxy 127.0.0.1:1984 {
		# 显式优化大文件和长连接流（非强制，但建议加上）
		flush_interval -1
	}

	# 可选：配置日志输出
	log {
		output file /var/log/caddy/go2rtc.log
	}
}
