Yom Kippur headache is a well documented phenomenon but the causes are unclear, but doctors have suspected withdrawal from caffeine, nicotine, oversleeping, and dehydration.
About 36% of subjects who took COX-2 inhibitor etoricoxib (related to Vioxx) developed headaches, compared to about 68% who took placebo. Those who took etoricoxib also had less severe headaches, and they had an easier time fasting.
References:
Could Vioxx cousin prevent religious fast headache? WebMD.
Image source: Etoricoxib, Wikipedia, public domain.