Triggers for headaches and migraines include stress the day before onset, dehydration, poor posture, lack of exercise, chemicals and poor sleep. Food &/or alcohol especially red wine and beer, chocolate, caffeine, dairy products e.g. aged cheese, food preservatives with nitrates and nitrites, MSG and artificial sweeteners such as aspartame may also trigger migraines and headaches and should be avoided when identified.
Zaeem Z, Zhou L, Dilli E. Headaches: a Review of the Role of Dietary Factors. Curr Neurol Neurosci Rep. 2016 Nov;16(11):101. https://www.ncbi.nlm.nih.gov/pubmed/27714637