Have had episodes of headaches before in the past especially smoking a strong full bodied smoke on an empty stomach. Also, after or during a smoke on a cold day.
Hence, I always try to have a smoke after a meal, especially since I usually smoke only full bodied cigars.
BTW, cigar smoking increase your Gastic Emptying time. So your stomach produces more acids during a smoke, and if your stomach is on the empty side, you may feel more nausea which can precipitate a migrane.
Ed