Anas bin Malik reported,

The Prophet ﷺ saw some phlegm on the wall of the qiblah, and it troubled him so much that the displeasure showed on his face. He stood up and scraped it off with his own hand, then said, "When one of you stands in prayer, he is conversing privately with his Lord," or he said, "his Lord is between him and the qiblah. So none of you should spit in the direction of the qiblah, but rather to his left, or under his foot."Then he took the edge of his cloak, spat into it, folded one part over the other, and said, "Or he may do like this."

Azami 3117

Sahih

عن أنس

أن النبي ﷺ رأى نخامة في القبلة، فشق ذلك عليه، حتى رئى في وجهه، فقام فحكه بيده، فقال: إن أحدكم إذا قام في صلاته، فإنه يناجي ربه، أو إن ربه بينه وبين القبلة، فلا يبزقن أحدكم قبل قبلته، ولكن عن يساره، أو تحت قدميه ثم أخذ طرف ردائه فبصق فيه، ثم رد بعضه على بعض فقال: أو يفعل هكذا.

الأعظمي 3117صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Mosques
Section
Prohibition of spitting in the masjid and towards the qibla
Numbering
Jami al-Kamil 3117 (2nd edition)
Azami 3117