Headaches are a common side effect from topical minoxidil. If you are experiencing side effects either stop the medication or lower the concentration of the minoxidil that is being applied to the scalp.
A headache could be a sign of reduced blood pressure from the Rogaine (minoxidil) so I would speak with your doctor and get your blood pressure checked out