Headaches and migraines can often result from food/drink that was consumed 24 hours prior, making it less obvious as to the source. If you spontaneously wake up with a headache, you may want to consider whether you had eaten the following (and perhaps removing it from your diet to see if it prevents further headaches).
Causes of headache:
Caffeine withdrawal is also an obvious headache source, with the higher your baseline dosage, the more intense the headache can be when consumption is ceased (it may take 48-72 hours to arise).