بُلُوغُ الْمَرَامِ
Bulugh al-Maram 213
The Book of Prayer
وَعَنْ عَامِرِ بْنِ رَبِيعَةَ - رضى الله عنه - قَالَ : { رَأَيْتُ رَسُولَ اَللَّهِ - صلى الله عليه وسلم -يُصَلِّي عَلَى رَاحِلَتِهِ حَيْثُ تَوَجَّهَتْ بِهِ } مُتَّفَقٌ عَلَيْهِ . [1]
Narrated 'Aamir bin Rabi'ah (RA): I saw Allah's Messenger (ﷺ) praying while mounted on his riding animal facing whatever direction it faced. [Agreed upon].
Sunnah.com reference: Book 2, Hadith 76