Sayyiduna Abdullah bin Amr (may Allah be pleased with him) narrates that the Prophet (peace and blessings be upon him) said: "Whoever has a headache in the path of Allah and hopes for reward, his sins before that are forgiven."
Al-Bazzar recorded it, and its chain is hasan (good).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الجنائز / 3805