Sunan an-Nasa'i, Book 8, Hadith 38 (Nasa'i 727)

It was narrated from Abu Sa'eed Al-Khudri that the Prophet (ﷺ) saw some spittle in the Qiblah of the Masjid. He scratched it off with a pebble and forbade a man to spit to his front or to his right. He said:

"Let him spit to his left or beneath his left foot."