Ecosystems worldwide receive large amounts of nutrients from both natural processes and human activities. While direct subsidy effects on primary productivity are relatively well known (the green food web), the indirect effects of subsidies on producers as mediated by the brown food web and predators have been neglected. With a dynamical green-brown food web model, parameterized using empirical estimates from the literature, we illustrate the effect of nutrient subsidies on net primary productivity (i.e., after removing loss to herbivory) in two generic ecosystems, terrestrial and aquatic. We find that nutrient subsidies increase net primary productivity because more nutrients are available, but this effect saturates with higher subsidies. Changing the quality of subsidies from inorganic to organic tends to increase net primary productivity in terrestrial ecosystems, but less often so in aquatic ecosystems. This occurs when organic nutrient inputs promote detritivores in the brown food web, and hence predators that in turn control herbivores, thus promoting primary productivity. This previously largely overlooked effect is further enhanced by ecosystem properties such as fast decomposition and low rates of nutrient additions, and demonstrates the importance of nutrient subsidy quality on ecosystem functioning.