Migraine is a chronic headache disease, which ranks second in years lost due to disability. However, the mechanism of migraines is still not clear. In migraine patients, fasting can trigger headache attacks. We explored the probable mechanism of why fasting can induce headaches. Nitroglycerin (NTG) was used to induce acute migraine attacks in mice. Primary astrocytes were used to study the pathophysiological mechanism and a Seahorse analyzer was used to detect mitochondrial function. NTG induced more serious headaches in the fasting group. Both the head-scratching times and climbing-cage times in the fasting group were higher than those in normal-diet group. More ROS and inflammatory factors, such as IL-6 and IL-1β, were induced in low-glucose conditions. Seahorse showed that the basal oxygen consumption rate (OCR) and OCR for ATP production were lower in mice who had received NTG with low glucose levels than in other groups. The activity of AMPK was inhibited in this group, which may explain the Seahorse results. We concluded that in the low-glucose state, astrocytes produce more inflammatory factors, ROS, which may be a result of mitochondrial metabolism dysfunction. Improving mitochondrial function and supplying enough substrates may be an option for relieving migraine attacks.