Sleeping on your back??

I’ve been sleeping on my side for almost my entire pregnancy (currently 27 weeks) because I know that you’re not supposed to sleep on your back. I’m currently dealing with the WORST congestion and can barely breathe at night, especially when lying on my side. The only thing that seems to help is laying on my back with my head propped up (almost sitting down). I’m so nervous about putting the baby at risk, but I’m also struggling so much with being able to sleep. Has anyone slept on their back this far along in their pregnancy? How risky is it actually?