In urban forests, soil fungal communities play a crucial role, but how the spatial distribution characteristics of fungi respond to changes in canopy structure remains unclear. This uncertainty represents an important knowledge gap, as the synergistic effect between the aboveground plant community and the underground fungal community significantly contributes to the stability, resilience, and anti-interference capability of the ecosystem. In this study, we characterized soil fungal communities in 30 plant communities with diverse canopy microhabitats within an urban forest ecosystem in China. Through network analysis and torus-translation testing, we were able to ascertain the microhabitats preferences of fungal species. Subsequently, we analyzed the fungi-environment relationships among various canopy microhabitats using NMDS, Mantel tests, and Pearson correlation analysis.The results revealed that different canopy microhabitats favor the presence of distinct fungal species, and there are notable differences in the fungi-environment relationships across various canopy microhabitats in warm temperate urban ecosystems. Our findings indicate that the distribution of fungi has strong associations with canopy microhabitats, which could exert significant effects on fungal diversity in warm temperate urban ecosystems. Our research provides novel insights into the mechanisms by which complex soil fungal communities respond to alterations in the canopy structure of plant communities.