It is narrated from Nafi' (may Allah have mercy on him), who narrated from Ibn Umar (may Allah be pleased with them both), and he says: I think Ibn Umar (may Allah be pleased with them both) narrated from the Prophet (ﷺ), mentioning the prayer of fear, so he said: "If the danger is severe, then pray while walking and on mounts, facing the qiblah or not facing the qiblah."
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 374
Hadith Takhrijأخرجه البخاري: التفسير، باب قوله فإن خفتم فرجالًا أو ركبانًا... إلخ (4535).