Migraine is a major cause of disability worldwide, particularly in young adults and middle-aged women. Xiongshao Zhitong Recipe (XZR) is a traditional Chinese medicine prescription used for treating migraine, but its bioactive components and therapeutic mechanisms remain unclear. We aimed to confirm the therapeutic effect of XZR on migraine and to determine the possible mechanism and bioactive components of XZR. Here, a sensitive UHPLC-LTQ-Orbitrap MS assay was carried out to analyze the ingredients of XZR, and a total of 62 components were identified, including coumarins, phenolic acids, phthalides, flavonoids, and terpenoids; among them, 15 components were identified in the serum samples after XZR treatment. We established a rat model of migraine via nitroglycerin (NTG) injection. The in vivo experiments demonstrated that XZR attenuated allodynia and photophobia in rats with NTG-induced migraine, and XZR also demonstrated analgesic effects. XZR reversed the abnormal levels of nitric oxide, 5-hydroxytryptamine (5-HT), calcitonin gene-related peptide (CGRP), and substance P (SP) to normal levels. XZR also downregulated inflammatory reactions, including mast cell degranulation and serum IL-1β, IL-6, and TNF-α levels. In terms of mechanism, we revealed that XZR treated NTG-induced migraine through the inhibition of neuronal nitric oxide synthase (nNOS) and inducible nitric oxide synthase (iNOS) expression in both the trigeminal nucleus caudalis (TNC) and periaqueductal gray matter (PAG), as well as the total NOS enzyme activity, which regulated the NF-κB signaling pathway. Additionally, imperatorin and xanthotoxin, two major ingredients of XZR, showed a high binding affinity to nNOS (Gly468-Leu616). In vitro, XZR, imperatorin, and xanthotoxin inhibited the nNOS expression and the NF-κB signaling pathway in lipopolysaccharide (LPS)-stimulated PC12 cells. In conclusion, we demonstrated the therapeutic effects of XZR and provided evidence that XZR played a critical anti-inflammatory role by suppressing NOS and NF-κB signaling pathway activation. Imperatorin and xanthotoxin were potential bioactive components of XZR. The findings from this study supported that XZR was a candidate herbal drug for migraine therapy.