Compared with encephalitis with headache symptoms group and pneumonia without headache symptoms group the serum levels of IL-4, TNF-α, IL-17A, and IL-12p70 were higher in migraine group than in pneumonia group, and the levels of IL-12p70 were higher than those in encephalitis group (p < 0.05). This evidence concerns the gene TNF and viral encephalitis.