Eternal, cannabis causes both vasoconstriction (blood vessel tightening) and vasodilation (blood vessel relaxation), most often with the constriction happening in the period right after you smoke and the dilation occurring once the THC and other cannabinoids have kicked in. Both vasoconstriction and vasodilation are headache triggers in lot of people.

People generally have headaches because the vessels in their scalp or the underlying muscle layer go into spasm; because of tension, which also causes muscle spasms and/or tightness; or because of a trigger in the trigeminal nerve pathway that causes chemicals to be released that make the blood vessels in the brain's outer covering become dilated and inflamed. That third one, the trigeminal trigger, is thought to be what happens in migraines. The medicines that best treat migraines nowadays are very powerful vasoconstrictors that cause those dilated, spasming veins to tighten up and behave themselves.

Sorry for the long answer, but we've been learning all about headaches in my neuroscience class. Headaches are the worst! So sorry you're having that experience.