Why do I have nausea and stomach pain only in the middle of the night?

Acid. Many people experience n and pain at night from excess acid production, possibly aggravated by a hiatal hernia. See your personal provider for further evaluation.