This study investigates the association between mRNA levels of genes involved in 7-methylguanosine (m7G) metabolism and the prognosis of herpes zoster. By analyzing the transcriptional profiles of m7G-related genes in herpes zoster from the GSE242252 dataset, it was found that NSUN2, AGO2, and SNUPN were differentially expressed between herpes zoster and normal controls (p <
0.05). AGO2 and SNUPN were negatively correlated with multiple immune cell infiltrations, while NSUN2 was positively correlated with immature B cell infiltration. A nomogram model based on NSUN2, AGO2, and SNUPN was constructed and showed good predictive ability, validated through clinical impact curve analysis (CICA), calibration curve, and decision curve analysis (DCA). The results suggest that a nomogram based on NSUN2, AGO2, and SNUPN can predict the risk of herpes zoster, and the relationship between these genes and immune infiltration may influence the prognosis of herpes zoster.Trial registration: This study was approved by the Institutional Review Board of the Fujian Medical University Union Hospital (No 2023QH003).