I have a very varied diet, and doesn't seem to matter what I eat or drink I get them whatever. I am trying to eat healthier with more fruit etc. but hasn't affected them whatsoever
What you eat or drink makes a huge difference on your immune response and will affect headaches through the inflammatory process. I would also say what you eat or drink plays a huge role in every health condition.
I would start taking chelated magnesium tablets daily for now.
Fruit contains a lot of fructose and that may not be the best thing for you right now. I would eliminate dairy, nuts, fruit, processed foods, and even limit meat intake to just a few times a week. No pork. Whole foods and foods with less than 5 ingredients is a good rule to go by. Try to eat less acidic foods and more alkaline foods. It's made a huge difference for me.