This is an interesting phenomenon in the world of physiology. We will start with the pain sensors in your body. The pain can come from anywhere in your body, but migraines are a common trigger for nausea. The majority of fibers in your nervous system are sensory fibers. Meaning your body is constantly monitoring its environment.
So these sensory nerve fibers go into your spinal cord and travel to your thalamus (an organ in the middle of your brain). Of course if we are talking migraine headaches the nerves bypass the spinal cord (but let’s not muddy the waters). The thalamus is right next to a structure called your solitary nucleus that is the origin of your vagus nerve (still with me?). The vagus nerve then travels down to your stomach and upper GI tract. So when you have pain stimuli entering into your thalamus you actually get a cross over firing of your vagus nerve, which in turn makes you feel nauseous. Same thing happens when you break a bone, get a really bad cut, get hit in the stomach etc etc. As Paul Harvey would say “now you know the rest of the story.”