I sometimes suffer from tension headaches and require either rest or paracetamol to cure.
If this happens on shabbos I will do either of the above. I have been told that paracetamol is ok as otherwise I will not be able to function.
I have recently found a new cure, rubbing a towel over the painful area for a few minutes and this provides a high level of relief.
Would such an action be permissible on shabbos and also yom Kippur? It is effectively a massage technique which relieves the tension.
According to what you are writing, it sounds like your headaches are severe enough to allow you to take medication for them. That being the case it would be permitted to massage yourself with the towel. The towel should however be dry so that when you rub it you are not squeezing any liquids out.
O:CH 328-17, 37, M:B 328-121,130.