In the Tuffs article linked below there is an interesting discussion on foods which trigger headaches for some people and the process to go through to see what might trigger your headaches. Here are a few of the common tiggers.
Compounds called biogenic amines, such as histamine, tyramine and phenylethylamine, may contribute to headaches in some people. Certain foods, such as tomatoes, avocados and spinach, naturally contain higher amounts of histamine and/or tyramine. Dark chocolate contains phenylethylamine. Amounts of biogenic amines are generally highest in foods in which bacteria break down certain amino acids, such as during fermentation or as the food ages, ripens or spoils. Examples are alcoholic beverages, fermented vegetables (like sauerkraut), processed meats (like salami), aged cheeses (like Swiss), soy sauce and some fish, particularly if mishandled.
Alcohol is a vasodilator, which means it causes blood vessels to expand. When blood vessels in the brain expand, the nerve fibers coiled around them are stretched. That activates the nerve fibers and can cause the release of inflammatory chemicals and pain. In addition to alcohol itself, certain products of fermentation (including histamine and tyramine) in alcoholic beverages, such as whiskey, beer and wine, may trigger a headache. Many of these fermentation products dilate blood vessels.
Caffeine is a vasoconstrictor. When you have caffeine in your system all of the time on weekdays, and then it wears off on the weekend [when you don’t get your typical coffee or other caffeinated drinks], you get rebound vasodilation. The result is a headache. Caffeine-withdrawal headaches are more likely with higher daily caffeine intake but can happen with as little as 100 milligrams of caffeine a day. That's about what’s in a cup of coffee or 2 cups of tea.
Headaches may be a symptom of celiac disease (a genetic-based illness requiring complete elimination of gluten, a protein in wheat, rye and barley). Headache also is a common complaint in those with non-celiac gluten sensitivity and in wheat allergy."
Other food or beverages may be the cause of your headaches. If you have frequent headaches, read this article and go through the steps to determine your triggers.