I almost never have headaches --- but sometimes certain wines --- just one glass --- will give me what I think could be a migraine. Coffee cures that and any minor headache I get so I don't need the unhealthy chemicals.
I had the same experience years ago with a certain wine I was drinking. My brother-in-law, who makes his own, explained what the problem was. It is due to a too high a level of sulfides or something like that in the wine. That is an indication of a bad brew.....