I saw the Prophet ﷺ on his Mount praying Nawafil by nodding his head, whatever direction he faced, but Messenger of Allah ﷺ never did the same in offering the compulsory prayers. (Using translation from Bukhārī 1097)
«رَأَيْتُ رَسُولَ اللَّهِ ﷺ يُسَبِّحُ وَهُوَ عَلَى الرَّاحِلَةِ وَيُومِئُ بِرَأْسِهِ قِبَلَ أَيِّ وَجْهٍ تَوَجَّهَ وَلَمْ يَكُنْ رَسُولُ اللَّهِ ﷺ يَصْنَعُ ذَلِكَ فِي الصَّلَاةِ الْمَكْتُوبَةِ»