Just in case you drink coffee every day, headache may be caused by caffeine withdrawal, and not by fasting.
Coffee drinkers or any people consuming caffeine every day (many industrial drinks contain caffeine ), should stop it at least 7-10 days prior to starting the water fast, that way caffeine withdrawal will not get mixed with food or Sugar withdrawal symptoms.