Introduction: Precision farming is an agricultural management practice that addresses various challenges by observing and measuring the variability of field crops, utilizing accurate and timely information about agricultural resources. A fundamental aspect of precision farming is the use of site-specific management zones (SSMZs). SSMZs improve agricultural management by customizing treatments for specific production zones, thereby conserving resources while enhancing crop productivity and quality. This research aimed to investigate the application of magnesium fertilizer in SSMZs for Allium cepa, as opposed to traditional methods based on soil and plant attributes. Methods: To achieve this, a 10-meter grid-sampling scheme was implemented across the field, comprising 12 points where soil samples were collected from the top 20 cm before planting green onions in June 2021. Normalized Difference Vegetative Index (NDVI) data during the harvest stage of the green onion growth cycle were sourced from Sentinel-2 satellite imagery at each sampling point. Yield mapping was performed at harvest. Key yieldlimiting factors were identified through stepwise multiple analyses, which included soil properties (such as organic matter) and canopy parameters (such as bulb diameter, phosphorus, magnesium, and NDVI). Results: Overlay maps illustrated soil parameters, growth, and biochemical measurements, and evaluated the effect of foliar spraying with different magnesium sources on the growth, productivity, and quality of green onions, indicating three distinct SSMZs: zone (I), zone (II), and zone (III), with areas of 1.97 ha, 1.35 ha, and 2.79 ha, respectively. The use of magnesium oxide nanoparticles (nMgO) in a site-specific management zone resulted in a remarkable green onion yield of 152.14 tons/ha. The assessed soil properties and plant characteristics revealed that foliar applications of (nMgO) significantly improved the nutritional status, growth, and quality of green onions (Allium cepa L.). Discussion: The modeling process effectively classified the study area into three management zones for soil treatments and three additional management zones for plant treatments. Implementing such a process will lower the costs of soil analysis and enhance overall agricultural income. © 2025 Elsevier B.V., All rights reserved.