Published in May 2018 in the Journal of Headache & Pain, this was an electronic survey of registered medicinal cannabis patients with headache, arthritis, and chronic pain. This paper focused on those patients with chronic headache pain.
The most actionable knowledge in this study seems to be that the cannabis chemovar that was MOST effective had Myrcene and Caryophyllene as the dominant terpenes, and THC as the dominant cannabinoid. It was a "hybrid" named OG Shark.
"Hybrid strains were preferred in ID Migraine™, headache, and most pain groups, with "OG Shark", a high THC (Δ9-tetrahydrocannabinol)/THCA (tetrahydrocannabinolic acid), low CBD (cannabidiol)/CBDA (cannabidiolic acid), strain with predominant terpenes β-caryophyllene and β-myrcene, most preferred in the headache and ID Migraine™ groups."
So if you are looking for cannabis to help with headaches, look for high Myrcene & Caryophyllene content. Everyone is different in their reactions to cannabis, but this study provides a sound place to start.
The study abstract with link to the full paper is here.