Welcome to HCM,
Due to acute ear infection
you might got enlarge ans painful lymph node on the back of your head might be giving this problem.
Your doctor might have prescribed antibiotic and anti-inflammatory medicines so do not worry and Wait for 2-3 days more and you will be alright.
Rule out possibility of having any problem on your scalp
, fungal infection
Ok and bye.