Not sure if you've ever had migraines, but I have. Luckily I don't get them often but I know those that do (once every couple weeks, lasting for 2-3 days). Reducing the frequency is a godsend.
I use to get about 2 a week.... then I went very low carb diet (keto) for weightloss.... and found the migraines massively reduced in frequency and intensity....
Dug around and found that this is a commonly reported side benefit of a ketogenic diet.
Sounds off the wall until you realize Keto diets were originally used for managing childhood epilepsy.
I would avoid anything with masked ingredients, for example "flavourings" or "natural flavourings" if they don't tell you what's in the flavouring it could be anything.