I'd also ask the same water question. How much water?
Are you just drinking a lot of water during your ride, or are you carrying on drinking more than usual afterwards to try and make the headache go away?
It's possible (but certainly not the only possible explanation) that you could be over-hydrating, and diluting your electrolyte levels too much, which can cause headaches.
Edit: We cross posted. That's quite a lot of water, but not a massive amount. Unless you're really sweating a lot, it probably isn't over-hydration. One way to test it would be to eat a packet of salty crisps when the headache comes on. If it goes away, even for a short while, it's a sign that you'd probably benefit from either drinking a bit less or adding electrolytes to your water.
The other thing to look at is your riding position. If you're tense around your neck and shoulders, or holding your head in an uncomfortable position, that could also cause headaches. The fact that they're going away overnight supports this theory because the tensed muscles would relax while you sleep.