I've been collecting data about my headaches and diet for almost four months now. I don't see any patterns - annoyingly, I get headaches nearly every day, so there's not much information - but I thought I'd post the data set and see if anyone sees anything. Here it is. Hopefully someone finds this an interesting problem.
It's written in note-to-self format (abbreviations like "strawbs" for "strawberries"; if I mention a complicated dish once then I'll shorten it when I eat the leftovers, as "pasta" for "pasta with artichokes and spinach and pesto"; times given approximately and not in a consistent form and often without specifying if they're a.m. or p.m., though they are in chronological order). Quantities aren't given, although if they're suspected to be relevant I may be able to remember specific instances (for unusual foods) or typical portions (for ordinary foods) - other details might also be recollectable similarly. I also don't notice when headaches go away, so I don't know how long they last except when they last all day or become noticeably worse during their course. My sleep schedule varied considerably over this period, but trends more night owl than early bird (for a while I was outright nocturnal). I moved three time zones west at the end of July, should that matter at all.
I'm not soliciting commentary on my diet except insofar as it can be compellingly related to my headaches.
ETA: Assume that every single day I'm drinking lots of skim milk. (2-6 cups depending on how much I eat and how it's spaced out.) There's a couple of exceptions, mostly when I'm in transit for most of a day or run out of milk, but not many and they don't seem to correlate with headaches.
I don't have any specific suggestions for you about headache causes.
Curetogether is crowdsourcing site to help people help each other figure out what's causing their health problems. The founder started it to deal with her headaches: http://quantifiedself.com/self-experiment/ http://curetogether.com/chronic-daily-headache/survey/symptoms/
Time of day seemed to be a significant factor in discovering the cause for her. That may be something you want to add to your logs.
There are always a lot of factors, and formalizing your experiments may help you figure out what the most significant causes are. You may want to try eating the same things every day for a while, at the same time, to reduce variation. You may also want to do things you don't usually, and stop doing things you do every day.
Chronic pain is a huge drain on one's life. I wish you all the best in moving towards decreased pain.