Hello and welcome to health care magic forums.
You are having the typical features of post nasal dripping associated with chronic sinusitis
. It means that you have collection of infected mucus in your sinuses
. Sinuses are air spaces around your face and nose. Sometimes the drainage
through these sinuses are blocked which will lead to headache cough
and infection. When you lie down for sleeping, this mucus will drip down due to gravity and produce irritation and cough and it usually occurs after midnight.
So, my advice is to visit an ENT specialist
or a physician and let him have a look. They will take an xray of your face. Usually it is curable by tablets but sometimes a drainage enhancing surgery called FESS is needed.
Hope this discussion will be helpful for you
Have a great day