Sahih al-Bukhari, Volume 2, Book 20, Hadith 202 (USC-MSA) ⓘ
Narrated 'Amir bin Rabi`a: I saw the Prophet on his Mount praying Nawafil by nodding his head, whatever direction he faced, but Allah's Messenger never did the same in offering the compulsory prayers.
حَدَّثَنَا يَحْيَى بْنُ بُكَيْرٍ، قَالَ حَدَّثَنَا اللَّيْثُ، عَنْ عُقَيْلٍ، عَنِ ابْنِ شِهَابٍ، عَنْ عَبْدِ اللَّهِ بْنِ عَامِرِ بْنِ رَبِيعَةَ، أَنَّ عَامِرَ بْنَ رَبِيعَةَ، أَخْبَرَهُ قَالَ رَأَيْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم وَهْوَ عَلَى الرَّاحِلَةِ يُسَبِّحُ، يُومِئُ بِرَأْسِهِ قِبَلَ أَىِّ وَجْهٍ تَوَجَّهَ، وَلَمْ يَكُنْ رَسُولُ اللَّهِ صلى الله عليه وسلم يَصْنَعُ ذَلِكَ فِي الصَّلاَةِ الْمَكْتُوبَةِ.
also referenced under: Book 18, Hadith 17 (In-Book) & Hadith 1097 (DarusSalam)
Narrated Salim: At night `Abdullah bin `Umar used to offer the prayer on the back of his animal during the journey and never cared about the direction he faced. Ibn `Umar said, "Allah's Messenger used to offer the optional prayer on the back of his Mount facing any direction and also used to pray the witr on it but never offered the compulsory prayer on it."
وَقَالَ اللَّيْثُ حَدَّثَنِي يُونُسُ، عَنِ ابْنِ شِهَابٍ، قَالَ قَالَ سَالِمٌ كَانَ عَبْدُ اللَّهِ يُصَلِّي عَلَى دَابَّتِهِ مِنَ اللَّيْلِ وَهْوَ مُسَافِرٌ، مَا يُبَالِي حَيْثُ مَا كَانَ وَجْهُهُ. قَالَ ابْنُ عُمَرَ وَكَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يُسَبِّحُ عَلَى الرَّاحِلَةِ قِبَلَ أَىِّ وَجْهٍ تَوَجَّهَ، وَيُوتِرُ عَلَيْهَا، غَيْرَ أَنَّهُ لاَ يُصَلِّي عَلَيْهَا الْمَكْتُوبَةَ.
also referenced under: Book 18, Hadith 18 (In-Book) & Hadith 1098 (DarusSalam)