It sounds like sleep deprivation is one of your triggers to developing a headache. The most common two types of headaches that are associated with sleep deprivation are migraine
headaches and tension headaches. Tension headaches begin in the back of the neck and move over the top to the front. A migraine headache often starts off with a prodrome of nausea or flashing lights and becomes a throbbing headache that usually stays on one side of the head. Based on your description, a migraine headache is most likely. There are various different triggers, but not getting enough sleep is definitely a common one. There probably won't be a diet that helps especially since you associate the headaches with sleep. The best thing will be for you to make sure you get enough sleep every night.
I suggest that you schedule an appointment with your primary care physician
. He or she can gather more detailed information about your headaches and perform a focused neurological exam. Your doctor
may determine that you are having migraines. If this is the case then you may need medication specific for them. If you are having more than just a few per month, then you may warrant medication taken daily to prevent the from coming on. In addition, you will always benefit from getting enough sleep every night.