Most headaches don't have a medical cause.
One point of view is that these headaches are halucinations.
They are caused by a conflict of two thoughts. I was taught to realize what the conflict was, and to put it aside, if it could not be resolved immediately. Make a concious decision to put the issue on a "back burner".
Then to do a excersize based on the idea that a headache persists, because it is resisted. It was taught sitting eyes closed with hands on legs.
Now... you try to experience the headache clearly. Locate it and then estimate it's size. A volume of one ounce of water, two... try to assign a color to it. Patiently sit and experience it. Again... estimate it's size. You may find that it becomes smaller. Eventually it becomes elusive. While trying to experience it clearly and accurately, it disappears.
I have been able to do this "process", driving in slow traffic, eyes open, with success. Fever headaches and hunger headaches, are for me, the ones I can't process out. Oddly, sometimes, headache remedies, taken for muscle pain for example, can give me a headache.
It was taught to me as part of the 60 hour, est Standard Training in the late seventies. Several things from that experience still help me to, cure a headache, or to take responsibility for the experience I create from the circumstances of my life. We can't control the facts... but we can control the context, in which we hold them. (Est is now called, The Landmark Education - Seminars).