Males often have reduced immune function compared to females but the proximate mechanisms underlying this taxonomically widespread pattern are unclear. Because immune function is resource-dependent and sexes may have different nutritional requirements, we hypothesized that sexual dimorphism in immune function may arise from differential nutrient intake (acquisition hypothesis). To test this hypothesis, we examined patterns of phenoloxidase (PO) activity in relation to nutrient consumption in Queensland fruit flies (Q-flies). In the first experiment, flies were allowed to choose their preferred nutrient intake. Compared with males, female Q-flies had higher PO activity, consumed more calories, and preferred a higher protein:carbohydrate (P:C) diet, suggesting that differential acquisition could explain sex differences. In the second experiment, we restricted flies to one of 12 diets varying in protein and carbohydrate concentrations and mapped PO activity for each sex onto a nutritional landscape. Counter to our hypothesis, females had higher PO activity than males at any given level of nutrient intake. Both carbohydrate and protein intake affected PO activity in females but only protein affected PO activity in males. Our results indicate that sex differences in Q-fly immune function are not solely explained by sex differences in nutrient intake, although nutrition does contribute to the magnitude of these sex differences.