Migraine headaches can be provoked by surgical stress and vasoactive effects of anesthetics of general anesthesia in the perioperative period. However, it is unclear whether general anesthesia increases the migraine risk after major surgery. Incidence and risk factors of postoperative migraine are also largely unknown. We utilized reimbursement claims data of Taiwan’s National Health Insurance and performed propensity score matching analyses to compare the risk of postoperative migraine in patients without migraine initially who underwent general or neuraxial anesthesia. Multivariable logistic regressions were applied to calculate the adjusted odds ratio (aOR) and 95% confidence interval (CI) for migraine risk. A total of 68,131 matched pairs were analyzed. The overall incidence of migraine was 9.82 per 1000 person-years. General anesthesia was not associated with a greater risk of migraine compared with neuraxial anesthesia (aORs: 0.93, 95% CI: 0.80–1.09). This finding was consistent across subgroups of different migraine subtypes, uses of migraine medications, and varying postoperative periods. Influential factors for postoperative migraine were age (aOR: 0.99), sex (male vs. female, aOR: 0.50), pre-existing anxiety disorder (aOR: 2.43) or depressive disorder (aOR: 2.29), concurrent uses of systemic corticosteroids (aOR: 1.45), ephedrine (aOR: 1.45), and theophylline (aOR: 1.40), and number of emergency room visits before surgery. There was no difference in the risk of postoperative migraine between surgical patients undergoing general and neuraxial anesthesia. This study identified the risk factors for postoperative migraine headaches, which may provide an implication in facilitating early diagnoses and treatment.