Urban food production is conducted in highly heterogeneous environments that have undergone considerable manipulation by building, demolition, and/or industrial pollution. This study evaluated soil quality characteristics in urban sites currently used for vegetable production across an urban to peri-urban gradient in Chicago, IL, USA. Twenty-one sites were classified based on the scale of management as private home gardens, community gardens, institutional farms, and private urban farms. We quantified indicators of soil fertility, nematode trophic composition, and indicators of the food web status (Maturity Index, Enrichment Index, Channel Index, and Structure Index). We also quantified concentrations of soil contaminants including lead (Pb), arsenic (As), and zinc (Zn). Analysis of free-living nematode families suggested that communities differ across sites based on their scale of management and are likely influenced by soil organic matter and soil pH. Concentrations of Pb, As, and Zn were below the levels of concern and did not influence nematode community structure. Finally, soil fertility was significantly increased by management, particularly in community gardens and urban farms. Adoption of best management practices in urban agriculture, such as reduced mixing through tillage, and the use of soil testing as a decision-support tool that helps optimize compost application, would reduce potential ecosystem disservices and promote food webs with greater functional diversity.