Hazrat Ali (may Allah be pleased with him) said that one should not perform prayer facing towards the toilet, bathhouse, or graveyard.