Your diet can impact your headache risk in two ways:
Specific foods are thought to trigger headaches.
Dietary habits such as skipping meals and dehydration may also play a role.
However, it doesn't seem to be this simple to classify dietary triggers. Often foods are triggers only when they are combined with other triggers (i.e. stress and hormone triggers). Also, a response to a food or beverage trigger may depend on how much of it is consumed. Another complication is the fact that some headaches may not occur for several hours to several days after consuming a trigger food -- making it even harder to identify.
These foods are potential migraine triggers:
Caffeine (i.e. coffee and sodas)
Any kind of alcohol