It could be from a sinus infection.
Could also be coming from the stomach.
You'll need to see a doctor in order to determine where it's coming from and what it is. Sorry.
Hello and hope you are doing well.
Your symptoms of bad foul smell in the nose could be due to sinus infections. They are due to stasis and infection of the sinus cavities, and the resultant drainage into the nose causes the bad smell. Facial pain, fever and nasal discharge are the other symptoms of sinusitis. You will need to consult your primary care physician for proper assessment. In the meantime practice good breathing exercises, humidify your room and do steam inhalations.
Hope this helped and do keep us posted.