The purpose of this study was to investigate whether the relationship between mental health and well-being among Chinese nurses could be mediated by factors such as night shift frequency and psychological flexibility. A total of 421 nurses were selected from 10 Grade secondary public hospitals in Shanghai, China. The 12-item General Health Questionnaire (GHQ-12) was used to assess mental health status. Additionally, psychological flexibility and well-being were assessed using the Chinese version of Personalized Psychological Flexibility Index and Chinese version of the 5-item WHO Well-Being Index, respectively. Correlation analysis showed that psychological flexibility was positively associated with well-being ( = 0.220, < 0.05) and negatively correlated with mental health issues ( = ‒0.225, < 0.05). Night shift frequency was linked to mental health issues ( = 0.276, < 0.05) and lower psychological flexibility ( = ‒0.165, < 0.05). Structural equation modeling demonstrated that age had direct positive effects on psychological flexibility (β = 0.130) and mental health (β = 0.541), while night shift frequency directly worsened mental health (β = 0.618) and reduced psychological flexibility (β = ‒0.198). Psychological flexibility significantly influenced both mental health (β = ‒0.674) and well-being (β = 0.418), with indirect effects on well-being (β = 0.268). Mental health was the strongest predictor of well-being (β = 0.718). These findings highlight the importance of psychological flexibility, night shifts and age in nurses' mental health well-being, though the study's cross-sectional design limits causal inferences. r p r p r p r p