Learning which foods bother you can be a difficult task. The best way to figure this out is by eliminating a certain food from your diet one at a time. Keep a food diary of what you are eating and when you get your headaches. It can be a slow process but you can narrow down which foods to discontinue eating.