The Mishnah Berurah in siman 94 says that if one is davening in a shul where there the Aron is facing south and the tzibbur is davening south instead of east, one should face south but turn one’s head east. Practically speaking what does that mean? How can one do that? Keeping the head towards the east is very uncomfortable and very strange looking for onlookers. What is one supposed to do in this situation?
The Mishnah Berurah does not mean that one should turn one’s head in a different direction to one’s body, but that one should angle one’s body towards the east. If the tzibbur davens in the wrong direction (south), one should not daven in a different direction to the tzibbur (east), but one should daven south-east.
Sources: Mishnah Berurah 94:9-10; this is also elucidated in Shoneh Halachos, 94.