TMJ, stress, sinus issues, allergies, the list goes on.
The suggestion of Magnesium is actually a good one. It is used often in the hospital when a patient's history of drug abuse is questionable. I was getting frequent headaches and migraines and personally tried a Vitamin B-Complex and Magnesium with considerable relief.
Vitamin B may prevent migraines
Prophylaxis of migraine with oral magnesium: resul... [Cephalalgia. 1996] - PubMed result
When I notice frequent headaches, I generally opt for a sinus rinse personally. All it really takes is a soft bulb syringe, salt and some opt to use baking soda as well. A
neti pot is more convenient. A lot of people are hesitant to pour water in their nose but I can tell you that it is cheap and really can work if allergies/pollutants are inflaming your sinuses.
*8 ounces of warm water
*1/2 to 1 teaspoon non-iodized salt
*A pinch of baking soda, or more, as needed.