If you suffer migraines and you drink coffee, STOP drinking coffee immediately. Even if you've been drinking coffee forever with no migraines until recently, trust me, stop the coffee.
They come back with stress, not enough breaks from mobile/monitors, and other unknowns.
Exercise daily getting your heart rate up has helped also.
There’s a migraine book out there about the exclusion diet where you slowly cut things out and make detailed logs. Log what you eat, what you did, felt, a super detailed journal. I never make it more than a few days of that.
Speaking out of personal and family experience.