is a normal event and it does not lead to any problems as you have mentioned in the history like headache, back pain
Hence no need to worry regarding masturbation as a cause for these symptoms.
These symptoms require evaluation to find out the underlying cause. The common causes are chronic infections, metabolic problems....
Hence I advice you to consult your doctor for examination and advice accordingly.