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?