Miscarriages happen in alot of different ways. The physical pain of a miscarriage can manifiest itself in a variety of different aches and pains that may seem unrelated to the pregnancy. Most of these pains are centered around the pelvis area and back.
A really bad headache is not necessarily one of the signs. I got incredibly brutal headaches with both my pregnancies; but, I didn't miscarry either child. Pregnancy puts a strain on your body that causes weaknesses that would have otherwise remain hidden to come to the fore. Headaches was my big issue during pregnancy - they were brutal and I didn't take any pain relievers because of the baby.
Now having said this, get checked out by your doctor. There is probably nothing wrong; but, it never hurts to get a medical opinion. When the baby has been delivered, go to the doctor about your headaches again because now you are in a different physical condition and something different may come to light.
I hope this helps.