The medicines could have triggered your bowel condition due to which you have facing such issues
Your gut might have given sensitive reaction to those medications
Next Steps
1) Stop the medications
2) Tab. Esomeprazole 40mg once in the morning before food
3) Avoid oily and spicy food
4) Avoid trigger factors of migraine such as bright light,heavy meals etc
5) If headache persists, then you can take the first tablet when pain occurs
You can follow this untill you consult your regular physician