Recent research highlights nature-based solutions to support biodiversity against climate change, but direct nutritional interventions need more assessment. We developed an insect model using fruit flies (Drosophila melanogaster) and the fungus Metarhizium robertsii and Beauveria bassiana to test if nutrient supplementation enhances behavioural responses to temperature change and infection. We examined yeast supplementation and behavioural thermoregulation in infected insects. Here we show that infected flies seek cooler temperatures to limit infection costs, effective only with specific nutrients available post-infection. Without yeast, cooler temperatures increase survival but decrease reproduction. Yeast supplementation in cooler environments enhances both lifespan and fecundity. Mechanistic studies show that fungal virulence decreases with yeast or tryptophan consumption, especially before infection intensifies. Tryptophan access is as effective as cold-seeking in reducing microbe loads. These findings suggest nutrition availability influences the effectiveness of behavioural thermoregulation in infected insects, establishing a model for nutrition-based solutions to human-induced climate change.