ObjectiveResilience has been reported as an important predictor of better mental health and prognoses in cancer patients, while its mechanisms were not clearly elucidated. In this study, we surveyed a large sample of nasopharyngeal carcinoma patients to investigate the mediating role of illness‐related cognition (illness perception, stigma and meaning in life) on the associations between resilience and symptoms of anxiety and depression.MethodsThis cross‐sectional study involved 773 participants diagnosed with nasopharyngeal carcinoma. Participants completed a self‐reported structured questionnaire to assess their illness perception, stigma and meaning in life, resilience and symptoms of anxiety and depression. Structural equation models (SEM) were employed to explore the relationship between resilience and symptoms of anxiety and depression in the entire sample, as well as in two subgroups: Subgroup I (0–1 year since diagnosis), and Subgroup II (over 1 year since diagnosis).ResultsIn the entire sample, after adjusting for potential confounders, illness perception, stigma and meaning in life were found to mediate the protective effect of resilience on symptoms of depression (mediating effect proportion: 65.25%) and anxiety (mediating effect proportion: 67.63%). In Subgroup I, direct effects were dominant in the associations between resilience and symptoms of anxiety (mediating effect proportion: 37.95%) and depression (mediating effect proportion: 29.13%). However, in Subgroup II, the associations between resilience and symptoms of anxiety (mediating effect proportion: 98.92%) and depression (mediating effect proportion: 81.04%) were completely mediated.ConclusionsOur study suggests that direct and indirect effects of resilience on depression and anxiety dominate in early periods (0–1 year) and long‐term periods (over 1 year) following the cancer diagnosis, respectively. The findings indicate that comprehensive intervention considering both the direct effect of resilience in early stages (e.g., health education prescription and social support groups) and the indirect effects of illness cognition in long‐term periods (e.g., cognitive behavioral therapies) are likely to yield the most favorable outcomes for cancer patients.