Environmental temperature has important effects on the physiology and life history of ectothermic animals, including investment in the immune system and the infectious capacity of pathogens. Numerous studies have examined individual components of these complex systems, but little is known about how they integrate when animals are exposed to different temperatures. Here, we use the Indian meal moth (Plodia interpunctella) to understand how immune investment and disease resistance react and potentially trade‐off with other life‐history traits. We recorded life‐history (development time, survival, fecundity, and body size) and immunity (hemocyte counts, phenoloxidase activity) measures and tested resistance to bacterial (E. coli) and viral (Plodia interpunctella granulosis virus) infection at five temperatures (20–30°C). While development time, lifespan, and size decreased with temperature as expected, moths exhibited different reproductive strategies in response to small changes in temperature. At cooler temperatures, oviposition rates were low but tended to increase toward the end of life, whereas warmer temperatures promoted initially high oviposition rates that rapidly declined after the first few days of adult life. Although warmer temperatures were associated with strong investment in early reproduction, there was no evidence of an associated trade‐off with immune investment. Phenoloxidase activity increased most at cooler temperatures before plateauing, while hemocyte counts increased linearly with temperature. Resistance to bacterial challenge displayed a complex pattern, whereas survival after a viral challenge increased with rearing temperature. These results demonstrate that different immune system components and different pathogens can respond in distinct ways to changes in temperature. Overall, these data highlight the scope for significant changes in immunity, disease resistance, and host–parasite population dynamics to arise from small, biologically relevant changes to environmental temperature. In light of global warming, understanding these complex interactions is vital for predicting the potential impact of insect disease vectors and crop pests on public health and food security.