Background: Herpes zoster (HZ) is strongly associated with decreased immune function, a factor of cancer development. Previous studies suggested inconsistent results regarding the association between HZ and increased cancer risk. We aimed to analyze the association between HZ and specific cancer risk. Methods: Of 134,454 patients diagnosed with HZ between 2002 and 2015, 81,993 HZ patients were matched 1:1 with non-HZ individuals by age, sex, and Charlson comorbidity index. Both groups were examined at 1, 3, and 5 years for cancer diagnosis. A Cox proportional hazard regression model was used to estimate cancer risk in both groups. The postherpetic neuralgia (PHN) and non-HZ groups were compared for specific cancer risk. Results: The HZ group showed a slightly decreased overall cancer risk compared with the non-HZ group (hazard ratio [HR] 0.94, 95% confidence interval [CI] 0.90–0.97, p = 0.002). The HRs for specific cancer risk were 0.41 (95% CI, 0.33–0.50, p < 0.001); 0.86 (95% CI, 0.81–0.91, p < 0.001); 0.87 (95% CI, 0.78–0.97, p = 0.014); 0.80 (95% CI 0.73–0.87, p < 0.001); 1.20 (95% CI, 1.07–1.34, p = 0.001); and 1.66 (95% CI, 1.35–2.03, p < 0.001) for cancers of the lips, mouth, and pharynx; digestive system; respiratory system; unknown secondary and unspecified sites; thyroid and endocrine glands; and lymphoid and hematopoietic systems, respectively. The HZ with PHN group showed higher HR for specific cancer risk, such as lymphoid and hematopoietic systems (95% CI, 1.27–2.39, p < 0.001). Conclusion: HZ was associated with increased or decreased incidence of specific cancers. PHN further increased the risk of developing certain cancers in HZ patients.