Modest dietary restriction extends lifespan (LS) in a diverse range of taxa and typically has a larger effect in females than males. Traditionally, this has been attributed to a stronger trade-off between LS and reproduction in females than in males that is mediated by the intake of calories. Recent studies, however, suggest that it is the intake of specific nutrients that extends LS and mediates this trade-off. Here, we used the geometric framework (GF) to examine the sex-specific effects of protein (P) and carbohydrate (C) intake on LS and reproduction in Drosophila melanogaster. We found that LS was maximized at a high intake of C and a low intake of P in both sexes, whereas nutrient intake had divergent effects on reproduction. Male offspring production rate and LS were maximized at the same intake of nutrients, whereas female egg production rate was maximized at a high intake of diets with a P:C ratio of 1:2. This resulted in larger differences in nutrient-dependent optima for LS and reproduction in females than in males, as well as an optimal intake of nutrients for lifetime reproduction that differed between the sexes. Under dietary choice, the sexes followed similar feeding trajectories regulated around a P:C ratio of 1:4. Consequently, neither sex reached their nutritional optimum for lifetime reproduction, suggesting intralocus sexual conflict over nutrient optimization. Our study shows clear sex differences in the nutritional requirements of reproduction in D. melanogaster and joins the growing list of studies challenging the role of caloric restriction in extending LS.