What causes headaches? – Dan Kwartler

A secondary headache is a symptom of a disease that can activate the pain-sensitive nerves of the head. Any number of conditions — varying greatly in severity — may cause secondary headaches.
Possible causes of secondary headaches include:
Acute sinusitis (nasal and sinus infection)
Arterial tears (carotid or vertebral dissections)
Blood clot (venous thrombosis) within the brain — separate from stroke
Brain aneurysm
Brain AVM (arteriovenous malformation)
Brain tumor
Carbon monoxide poisoning
Chiari malformation (structural problem at the base of your skull)
Concussion
Coronavirus disease 2019 (COVID-19)
Dehydration
Dental problems
Ear infection (middle ear)
Encephalitis (brain inflammation)
Giant cell arteritis (inflammation of the lining of the arteries)
Glaucoma (acute angle closure glaucoma)
Hangovers
High blood pressure (hypertension)
Influenza (flu) and other febrile (fever) illnesses
Intracranial hematoma
Medications to treat other disorders
Meningitis
Monosodium glutamate (MSG)
Overuse of pain medication
Panic attacks and panic disorder
Persistent post-concussive symptoms (Post-concussion syndrome)
Pressure from tight headgear, such as a helmet or goggles
Pseudotumor cerebri (idiopathic intracranial hypertension)
Stroke
Toxoplasmosis
Trigeminal neuralgia (as well as other neuralgias, all involving irritation of certain nerves connecting the face and brain)
Some types of secondary headaches include:
(commonly called brain freeze)
Medication overuse headaches (caused by overuse of pain medication)
Sinus headaches (caused by inflammation and congestion in sinus cavities)
Spinal headaches (caused by low pressure or volume of cerebrospinal fluid, possibly the result of spontaneous cerebrospinal fluid leak, spinal tap or spinal anesthesia)
Thunderclap headaches (a group of disorders that involves sudden, severe headaches with multiple causes)
https://www.mayoclinic.org/symptoms/headache/basics/causes/sym-20050800