If you think this headache might be caused by allergies, have you recently changed laundry detergent? If you're lying on a pillow for 6 to 8 hours every night, you might want to launder your pillow case in a hypoallergenic laundry detergent. Also, what kind of shampoo/hairspray/hair gel are you using? It could be getting on the pillow and you could be inhaling your allergens all night.
Have you vacuumed the dust bunnies from beneath and behind your bed? You could be breathing in all kinds of icky stuff at night while you sleep.
Also, gross as this sounds, you want to change your pillow every year. My Ex-Lax was so attached to his old pillow and when I finally showed it to him in the light of day, he was convinced that his smelly drooled-upon pillow was causing most of his sleep problems. So, he got rid of the pillow. (And he got rid of me, too.
)