My first piece of advice is to see a doctor. If you are suffering something other than a concussion, that's important to know. However, if you are suffering concussions, you are risking your health in a serious way, and that's even more important to know.
Concussions ARE brain damage
All the current science points to the fact that concussions produce permanent damage. The "recovery" from a concussion is your brain re-wiring itself around the damage. Enough concussions, enough damage, and your brain lacks enough connections to keep it going - and people end up with memory, speech, emotional problems. Or death. A lot of high school sports deaths in the US are directly tied to concussions.
If you suffer headaches after any of these hits, you need to end that session of training. If the headaches get worse AFTER the hit, you should go seek medical care immediately. Concussions turn to death typically within a few hours to a day after receiving them - as brain swelling isn't immediate - and if symptoms worse, that's your small window to get help.
Avoiding Concussions
Let's say you go to the doctor and it does turn out to be some other issue that is treatable, and you're still worried about concussions as a separate issue.
My previous answer about boxers dealing with head blows sums it up. You can condition your neck to improve stabilizers, you can learn to block better, and roll with the blows.
However, if it turns out you have been taking concussions this whole time? You need to stop engaging in full contact sports. The sports medicine teacher I trained under, who coached football, had a rule: 3 concussions in your high school career, and you're out of the sport forever. It wasn't worth risking your life or permanent disability for fun.