I very rarely get headaches, but two things that have triggered headaches for me are red wine - especially when I've had it for several nights in a row, and decaf coffee (regular might do the same thing, I haven't had it in ages).
How might these two phenomena be related? Could it be the tannins, and if so, why?
Wine is high in histamines, and if you have an intolerance to them it can be a trigger for a migraine, as mentioned. I'm not sure about the coffee though as I thought it was caffeine which could lead to a migraine but if your drinking decaf then I'm not sure.