Also make sure that you are keeping hydrated.
Headaches in pregnancy in combination with other symptoms such as high blood pressure for example can be a sign of serious disorders so you'd be wise to get checked out by your gp. On the other hand it could be that your pillow is contributing, the room is too warm, you're a bit dehydrated etc. But your gp should be your first point of call. Good luck, I hope it's all good.