When the Messenger of Allah ﷺ was on a journey and wished to say voluntary prayer, he made his she-camel face the qiblah and uttered the takbir (Allah is most great), then prayed in whatever direction his mount made his face.
أَنَّ رَسُولَ اللَّهِ ﷺ كَانَ إِذَا سَافَرَ فَأَرَادَ أَنْ يَتَطَوَّعَ اسْتَقْبَلَ بِنَاقَتِهِ الْقِبْلَةَ فَكَبَّرَ ثُمَّ صَلَّى حَيْثُ وَجَّهَهُ رِكَابُهُ