{
	auto_https off
	admin off
	servers {
		protocols h1 h2
	}
}

# API server proxy for TUI WebSocket connections
:80 {
	# Health check endpoint
	handle /health {
		reverse_proxy api-server:9101
	}

	# WebSocket endpoint for TUI
	handle /ws* {
		reverse_proxy api-server:9101 {
			header_up Connection {>Connection}
			header_up Upgrade {>Upgrade}
		}
	}

	# API endpoints
	handle /api/* {
		reverse_proxy api-server:9101
	}

	# Default response
	handle {
		respond 404
	}
}
