These nutrients can help manage painful headaches.