The occurrence of public health emergency in China often makes nurses more susceptible to anxiety. The present study aimed to investigate the prevalence of anxiety among Chinese nurses during the public health emergency and explore the association between family function and anxiety and its underlying mechanisms. Family care index questionnaire, Connor-Davidson Resilience scale, physical activity rating scale and 7-item Generalized Anxiety Disorder Scale were employed to measure family function, resilience, physical activity and anxiety among 779 Chinese nurses during public health emergency. The prevalence of anxiety among nurses during public health emergency was 29.9%. Resilience partially mediated the association of anxiety with family function. Physical activity moderated the direct and indirect effects of family function on anxiety. The direct effect became insignificant when the standard scores of physical activity were 0.629 and over. In contrast, the indirect effect of family function on anxiety through resilience was stronger when the levels of physical activity increased. The present study suggested for nurses with low levels of physical activity, intervention enhancing family function should be designed to prevent anxiety. For those with higher levels of physical activity, programs aimed at strengthening family function and supporting resilience should be developed to manage anxiety.